Monday, March 9, 2015

Use Html attributes for TextBoxFor in ASP.NET MVC ?

Use Html attributes for TextBoxFor in ASP.NET MVC ?

This is the way to generate TextBox with certain properties.

 

image

 

  1: @Html.TextBoxFor(model => model.properyName, new { @maxlength="25",disabled = "disabled",@class = "form-control" })


This will generate a textbox that matches your property name and will also populate the textbox with any values that are contained within the Model.


To know more MVC and WebApi Kindly go through with these links

MVC Articles & WCF and WebApi

Thanks.
Enjoy coding and reading.

0 comments :

Post a Comment