What is the difference between mvc HTML.Control and ControlFor (TextBox, checkbox etc)..
What is the difference between mvc HTML.Control and ControlFor (TextBox, checkbox etc)..
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
One is strongly typed. If you have a view that expects a model of type Customer with a property “CustomerName”, you can render the value with either way
With the second method (lambda expression), you avoid magic strings. You also have the ability to inspect ModelMetadata to perform additional customizations.
Read about Model metadata here:
http://bradwilson.typepad.com/blog/2009/10/aspnet-mvc-2-templates-part-2-modelmetadata.html