Telerik Extensions for ASP.NET MVC

Version Q1 2012, released 04/19/2012

Server Validation

Validation summary

*

About this example ASPXRazor

This example shows how Telerik NumericTextBox for ASP.NET MVC is being validated through the built-in server-side validation capabilities of ASP.NET MVC.


<%= Html.ValidationSummary() %>
<% using (Html.BeginForm("Action", "Controller")) { %>
    <%= Html.Telerik()
            .NumericTextBox()
            .Name("piecesOfCake")
    %>
    <%= Html.ValidationMessage("piecesOfCake", "*") %>
    <input type="submit" value="Post" />
<% } %>

Additionally you can use NumericTextBoxFor extension in order to create NumericTextBox for a concrete Model property. If it has Range attribute, NumericTextBox component will use it to define min and max value contraints.

Get more than expected!

Take the Telerik Extensions for ASP.NET MVC to your Visual Studio projects to truly experience their power. Download your free copy now and jumpstart your development with the available learning resources.

The Extensions are offered in both open source and commercial versions the differences between which are well explained in the licensing FAQ.

If you have any questions, do not hesitate to contact us at sales@telerik.com.

Other Demos: