WHAT IS THE DIFFERENCE BETWEEN “HTML.TEXTBOX” VS “HTML.TEXTBOXFOR”?

Anupam Mishra

Total Post:135

Points:949
Posted by  Anupam Mishra
 764  View(s)
Ratings:
Rate this:
Hi Everyone,
I am using  ASP.NET MVC4 and defining a text box using HTML.TextBox html helper class .But i want to know what is difference between “HTML.TextBox” and “HTML.TextBoxFor”. Please give me a solution.

Thank you.
  1. Anupam Mishra

    Post:135

    Points:949
    Re: What is the difference between “HTML.TextBox” vs “HTML.TextBoxFor”?

    “HTML.TextBox” vs “HTML.TextBoxFor” both are  give the same output. “HTML.TextBoxFor” is strongly typed while “HTML.TextBox” isn’t.
    Html.TextBox("StudentCode")
    Here ,  “Html.TextBoxFor” code which creates HTML textbox using the property name ‘StudentCode” from object “m”.
    Html.TextBoxFor(m => m.StudentCode)

      Modified On Feb-04-2016 10:38:57 PM

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!