First make sure you add the scripts as shown below
bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include( "~/Scripts/jquery-1.7.1.min.js", "~/Scripts/jquery.validate.min.js", "~/Scripts/jquery.validate.unobtrusive.min.js"));
And make sure the above package is defined in the BundleConfig class, as shown below:
public class BundleConfig { public static void RegisterBundles(BundleCollection bundles) { bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include( "~/Scripts/jquery-1.7.1.min.js", "~/Scripts/jquery.validate.min.js", "~/Scripts/jquery.validate.unobtrusive.min.js")); } }
Wildcard
"*" is used to combine files in the same directory and has the same prefix or suffix with its name. Suppose you want to add all the script files that exist in the "~ / Script" directory and have "jquery" as the prefix, then you can create a set as shown below:
bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include("~/Scripts/jquery*.js"));
All packages are registered in the Application_Start application of the Global.asax file of your web application.
protected void Application_Start() { BundleConfig.RegisterBundles(BundleTable.Bundles);
source share