Differences between Html.TextboxFor and - TopicsExpress



          

Differences between Html.TextboxFor and Html.EditorFor TextBoxFor: It will render like text input html element corresponding to specified expression. In simple word it will always render like an input textbox irrespective datatype of the property which is getting bind with the control. EditorFor: This control is bit smart. It renders HTML markup based on the datatype of the property. E.g. suppose there is a boolean property in model. To render this property in the view as a checkbox either we can use CheckBoxFor or EditorFor. Both will be generate the same markup. What is the advantage of using EditorFor? As we know, depending on the datatype of the property it generates the html markup. So suppose tomorrow if we change the datatype of property in the model, no need to change anything in the view. EditorFor control will change the html markup automatically. The advantages of EditorFor is that your code is not tied to an
Posted on: Tue, 08 Oct 2013 22:34:31 +0000

Trending Topics



Recently Viewed Topics




© 2015