Friday, September 19, 2014

How to display Textbox input to upper case in ASP.NET MVC razor view?

1. Create css class
.uppercase
{
text-transform: uppercase;
}

2. Add this class into Textbox in razor view
@Html.TextBoxFor(model => model.PostCode, new { @class = "uppercase" })

Note: the value still keeps original value.

No comments:

Post a Comment