Sunday, October 31, 2010

How to add attributes with controls in MVC2

this is how we can add attributes with HTML controls in MVC2 :


< %: Html.TextBox("txtfind", null, new { @maxlength = "5", @class = "findInput" })% >


in above sample we are setting max length property of textbox to 5 and adding its css class name "findinput".

Solutions By:Rajesh Rolen

Share This!


No comments:

Powered By Blogger · Designed By Seo Blogger Templates