I want to change the background of the textbox. This is my code:
@Html.TextBoxFor(p => p.Publishers[0].pub_name)
What more do I need to write in TextBoxFor to change the background?
I want to change the background of the textbox. This is my code:
@Html.TextBoxFor(p => p.Publishers[0].pub_name)
What more do I need to write in TextBoxFor to change the background?
An overload of the TextBoxFor method allows you to pass an object for the HTML attributes.
Then you can have a CSS rule such as:
If you want to apply a style directly you can do:
Now you can add html attributes like this:
In my case I did like below. I have ASP.NET MVC application and we are using Bootstrap. I gave float:left to all my div elements. Just wanted to show how you can use @style along with @class for @Html.TextBoxFor