Search code examples
htmlasp.net-mvc-4inputrazor

How to apply input which has a type email to to HTML Helper in Asp.net MVC3 Razor


How to apply input which has a type email to HTML Helper in Asp.net MVC3 Razor. For example:

 <input type="email" name="name" value=" " placeholder="[email protected]" />

Is there alternative in Razor?


Solution

  • You can use Html.TextBox method.

    @Html.TextBox("name","", new { type = "email", placeholder = "[email protected]" })