asp.net MVC

How to apply css class for html textbox asp.net MVC?

How to apply css class for html textbox asp.net MVC?, someone asked me to explain?

In this article I will show you how to apply html TextBoxFor class in asp.net mvc Razor view. The simplest way is,

   @Html.TextBoxFor(model => model.Title, new { Class= "form-control" }) 

Here I applied bootstrap css class for textbox(TextBoxFor) in form.

html textboxfor class in asp.net mvc Razor view

Post your comments / questions