Reputation: 99
I'm working on an MVC application.
I have the following line of code:
@Lines.Html.TextBox(p => p.Dscription)
How can apply my own style to this text box? i.e. change the width?
Upvotes: 0
Views: 1804
Reputation: 1503
There is an overload of (Textbox) html helper:
@Lines.Html.TextBox(p => p.Dscription, null, new { @class = "css-class" })
Upvotes: 0
Reputation: 8428
You can just append a generic object as the second parameter which contains the appropriate attributes ::
@Lines.Html.TextBox(p => p.Description, new { @class = "className", @style = "width: 200px" }
Upvotes: 1
Reputation: 2385
add another param to the helper:
@Lines.Html.TextBox(p => p.Dscription, new {@class="clasecss", more properties})
Regards,
Upvotes: 0