Adding Attributes to Razor TextBox in Asp.Net MVC

Hi Kids,

Here is how to add attributes to Razor’s TextBox in Asp.Net MVC

@using (Html.BeginForm())
   @Html.TextBox("fullNameString", null ,new { @class = "form-control" , @placeholder = "Full Name" })

You’re welcome Kids!


It's only fair to share...Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn

Leave a Reply

Your email address will not be published. Required fields are marked *