Tuesday, August 31, 2010

ASP.NET MVC HTML helper methods for new HTML5 input types

Programmer Question

HTML5 appears to support a new range of input fields for things such as:




  • Numbers

  • Email addresses

  • Colors

  • URLs

  • Numeric range (via a slider)

  • Dates

  • Search boxes



Has anyone implemented HtmlHelper extension methods for ASP.NET MVC that generates these yet? It's possible to do this using an overload that accepts htmlAttributes, such as:



Html.TextBoxFor(model => model.Foo, new { type="number", min="0", max="100" })


But that's not as nice (or typesafe) as:



Html.NumericInputFor(model => model.Foo, min:0, max:100)


Find the answer here

1 comment:

  1. Hello,
    ASP net programming is software developed by Microsoft, which permit programmer all around to create dynamic websites and web applications
    asp.net programmer

    ReplyDelete

LinkWithin

Related Posts with Thumbnails