ProgrammerGuide.Net | Step by Step Programmer Guide

What is the difference between HTML.TextBox vs HTML.TextBoxFor | ASP.NET MVC Interview Question

Both of them provide the same HTML output. However,  HTML.TextBoxFor is strongly typed while HTML.TextBox is not.

Below is a simple HTML code which just creates a simple textbox with ‘CustomerName’ as name.

Html.TextBox(“CustomerName”)

Below is Html.TextBoxFor code which creates HTML textbox using the property name ‘CustomerName’ from object ‘m’.

Html.TextBoxFor(m => m.CustomerName)
Please click here for related products on Amazon!

Jayashee

Add comment

Want to Check Celebrities News?