1

Step 1- We have merge 1) jquery-1.7.2.js, 2) jquery.unobtrusive-ajax.js, 3) jquery.validate.js, 4) jquery.validate.unobtrusive.js In Single file using online js compressing tool. And saved that new file in our application script folder.

Step 2- When we are using new file in our application by using " script src="Domain_Path"+"/Scripts/CDNScripts/jqueryval.js" type="text/javascript">"/script> Its working very good.

Step 3- BUT when we are using bundling and CDN like below. bundles.UseCdn = false; string JqueryvalCND = "Domain_Path" + "/Scripts/CDNScripts/jqueryval.js"; bundles.Add(new ScriptBundle("~/bundles/jqueryval", JqueryvalCND).Include( "~/Scripts/CDNScripts/jqueryval.js"));

    **It producing error "'jQuery' is undefined "**

Please suggest urgent

1
  • try changing the order of including bundles Commented Nov 5, 2013 at 9:05

1 Answer 1

0

You need to include your bundle in your page too :

Razor : @Scripts.Render("~/bundles/jqueryval")

Web Forms : <%: Scripts.Render("~/bundles/jqueryval") %>

Sign up to request clarification or add additional context in comments.

2 Comments

Hi, thanks for comment. That I have already added like "@System.Web.Optimization.Scripts.Render("~/bundles/jqueryval")" in my _Layout(master page) page and this error still there, I think when we are using CDN then the file which we have included there that stores in its memory and when we are going to access that file its produce error. Please suggest what I do. Thanks
Render "@System.Web.Optimization.Scripts.Render("~/bundles/jqueryval")" at the place you have render other scritps. It will work. My code start working now by above rendering Thanks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.