Back to Browse

Part 36 Difference between Html TextBox and Html TextBoxFor

152.8K views
Jun 11, 2013
12:21

Let's understand the difference between TextBox and TextBoxFor & DropDownList and DropDownListFor HTML helpers with an example. Please watch Part 35, before proceeding. Healthy diet is very important both for the body and mind. If you like Aarvi Kitchen recipes, please support by sharing, subscribing and liking our YouTube channel. Hope you can help. https://www.youtube.com/channel/UC7sEwIXM_YfAMyonQCrGfWA/?sub_confirmation=1 So, in short, here are the differences Html.TextBox amd Html.DropDownList are not strongly typed and hence they doesn't require a strongly typed view. This means that we can hardcode whatever name we want. On the other hand, Html.TextBoxFor and Html.DropDownListFor are strongly typed and requires a strongly typed view, and the name is inferred from the lambda expression. Strongly typed HTML helpers also provide compile time checking. Since, in real time, we mostly use strongly typed views, prefer to use Html.TextBoxFor and Html.DropDownListFor over their counterparts. Whether, we use Html.TextBox & Html.DropDownList OR Html.TextBoxFor & Html.DropDownListFor, the end result is the same, that is they produce the same HTML. Strongly typed HTML helpers are added in MVC2. Text version of the video http://csharp-video-tutorials.blogspot.com/2013/06/part-36-difference-between-htmltextbox.html Slides http://csharp-video-tutorials.blogspot.com/2013/09/part-36-htmltextbox-vs-htmltextboxfor.html All ASP .NET MVC Text Articles http://csharp-video-tutorials.blogspot.com/p/aspnet-mvc-tutorial-for-beginners.html All ASP .NET MVC Slides http://csharp-video-tutorials.blogspot.com/p/aspnet-mvc-slides.html All Dot Net and SQL Server Tutorials in English https://www.youtube.com/user/kudvenkat/playlists?view=1&sort=dd All Dot Net and SQL Server Tutorials in Arabic https://www.youtube.com/c/KudvenkatArabic/playlists

Download

0 formats

No download links available.

Part 36 Difference between Html TextBox and Html TextBoxFor | NatokHD