Tutorial by Examples

public class UserModel { [Required] [StringLength(6, MinimumLength = 3)] [RegularExpression(@"(\S)+", ErrorMessage = "White space is not allowed")] public string UserName { get; set; } [Required] [StringLeng...
<appSettings> <add key="ClientValidationEnabled" value="true"/> <add key="UnobtrusiveJavaScriptEnabled" value="true"/> </appSettings>
<package id="jQuery" version="1.10.2" targetFramework="net452" /> <package id="jQuery.Validation" version="1.11.1" targetFramework="net452" /> <package id="Microsoft.jQuery.Unobtrusive.Validation" version="3....
@model WebApplication4.Models.UserModel @{ ViewBag.Title = "Register"; } <h2>@ViewBag.Title.</h2> @using (Html.BeginForm("Register", "Account", FormMethod.Post, new { @class = "form-horizontal", role = "form" })) { @Htm...
public class BundleConfig { public static void RegisterBundles(BundleCollection bundles) { bundles.Add(new ScriptBundle("~/bundles/jquery").Include( "~/Scripts/jquery-{version}.js")); bundles.A...
public class MvcApplication : System.Web.HttpApplication { protected void Application_Start() { AreaRegistration.RegisterAllAreas(); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes);...

Page 1 of 1