How do I specify attributes for a Html.TextBox helper while maintaing the value retreival from ViewD
Posted
by BigJoe714
on Stack Overflow
See other posts from Stack Overflow
or by BigJoe714
Published on 2008-11-14T20:21:10Z
Indexed on
2010/04/14
19:33 UTC
Read the original article
Hit count: 199
asp.net-mvc
I am using the Html.TextBox helper to create textboxes. I want to set attributes on the textbox, which I understand is done using the following overload:
Html.TextBox (string name, object value, object htmlAttributes)
However, I want to maintain the functionality where the html helper automatically uses the value from either ViewData or ViewData.Model and I do not see a way to just specify the name and the htmlAttributes. Is this possible?
© Stack Overflow or respective owner