Project Description
This library is complete set of Validation Controls for ASP.NET MVC imported from ASP.NET WebForms in MVC Style, which are used in WebForms. It makes client side validation easier both for Developer and Designer with less code. It's developed in C#.
Feedback requested
USAGE:
On Web.Config
<pages>
<controls>
<add tagPrefix="v" namespace="Classic.Mvc.Web.UI" assembly="Classic.Mvc.Web.UI"/>
</controls>
<namespaces>
<add namespace="Classic.Mvc.Web.UI"/>
</namespaces>
</pages>
On Site.Master
<v:ValidatorScriptManager runat="server"></v:ValidatorScriptManager>
On View (eg. Index.aspx)
<%=Html.ValidationSummary("aaa",
props =>
{
props.ShowSummary = true;
props.ShowMessageBox = true;
props.ValidationGroup = "test";
})%>
<input id="username" />
<%= Html.RequiredFieldValidator("reqVal_ username", "username",
options =>
{
options.Text = "*";
options.ErrorMessage = "Invalid Username";
options.SetFocusOnError = true;
options.ValidationGroup = "test";
})%>
in submit handler of form (in javascript block or file) use following statements to check validity of controls and block submission of form
if(!Page_ClientValidate("test")){
return false;
}
"test" is validation group. You can use ValidationGroup to distinguish between forms