0

I upgraded my mvc3 project to mvc4 and also Telerik 2013 Q3 to 2014 Q1. it's my app_start > RegisterBundles

        bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
             "~/Scripts/jquery.min.js"));

        bundles.Add(new ScriptBundle("~/bundles/kendo-web").Include(
                    "~/Scripts/kendo.web.min.js",
                    "~/Scripts/kendo.aspnetmvc.min.js",
                    "~/Scripts/kendo.timezones.min.js"));


        bundles.Add(new StyleBundle("~/Content/web/css").Include(
                    "~/Content/web/kendo.common.min.css",
                    "~/Content/web/kendo.rtl.min.css",
                    "~/Content/web/kendo.default.min.css"));

        bundles.IgnoreList.Clear();

it's my Application_Start

 protected void Application_Start()
    {
        AreaRegistration.RegisterAllAreas();

        RegisterGlobalFilters(GlobalFilters.Filters);
        RegisterRoutes(RouteTable.Routes);
        BundleConfig.RegisterBundles(BundleTable.Bundles);
    }

and this is _Layout.cshtml

  <link href="@Url.Content("~/Content/site.css")" rel="stylesheet" type="text/css" />
  @Styles.Render("~/Content/web/css")
  @Styles.Render("~/Content/shared/css")

  @Scripts.Render("~/bundles/jquery")
  @Scripts.Render("~/bundles/kendo-web")

but when I Run the web site I got this error : Unhandled exception at line 50, column 199 in http://localhost:62089/Scripts/jquery.validate.min.js

0x800a138f - JavaScript runtime error: Unable to get property 'call' of undefined or null reference

If there is a handler for this exception, the program may be safely continued.

I upgraded jquery.validation to latest version but this error is remained. what is this error for? I upgraded all required dependencies. there is problem in IE11 and In firefox I don't have this.

Ehsan Sadeghi
  • 117
  • 1
  • 4
  • 17
  • Please read the question. I mentioned this : **bold**I upgraded jquery.validation to latest version but this error is remained.**bold** – Ehsan Sadeghi Jul 03 '14 at 17:00
  • We need both **jquery** and **jquery.validate.min.js** versions, because some jquery are not compatible with jquery.validate. Otherwise, I won't waste my time asking you. [Error in jquery.validate.js in MVC 4 Project with jQuery 1.9](http://stackoverflow.com/questions/14659023/error-in-jquery-validate-js-in-mvc-4-project-with-jquery-1-9) – Win Jul 03 '14 at 17:07
  • Jquery 2.1.1 and jquery.validation 1.13.0 – Ehsan Sadeghi Jul 03 '14 at 17:27

1 Answers1

0

I could not replicate the error in brand new MVC 4 project with jQuery 2.1.1 and jQuery.Validation 1.13.0.

One thing I notice is that jquery.validate is not in your code.

Could you make sure jquery.validate is added to the bundle as well as to the page?

BundleConfig.cs

bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
                        "~/Scripts/jquery.unobtrusive*",
                        "~/Scripts/jquery.validate*"));

At the page that you want the clientside validation

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

The worst case you can try to include jquery migrate plugin to your bundling:

  bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
              "~/Scripts/jquery-{version}.js",
              "~/Scripts/jquery-migrate-{version}.js"));
Win
  • 61,100
  • 13
  • 102
  • 181