Why am I getting the "Page_Validators is undefined" error when I switch IE browser mode from IE9 to IE8?

I am developing a web page using ASP.NET unobtrusive validation. When I view my page in IE9 using IE9's default browser mode, the page works as expected. However, when I just switch browser mode from IE9 to IE8, I get the following JavaScript error on page reload:

"Error: 'Page_Validators' undefined"

Unobtrusive validation requires a ScriptResourceMapping named "jquery". It's in place. I am also using the <script>

homepage tag to include jquery on all pages.

Also, I have an empty tag on the master page so that my custom control can load other javascript via the ScriptManagerProxy tag in the markup of the control.

Relevant markup on the main page:

<%@ Master Language="C#" AutoEventWireup="true" Inherits="Site" Codebehind="Site.master.cs" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">

<script src="Scripts/jquery-1.8.3.min.js" type="text/javascript"></script>

<title></title>

<asp:ContentPlaceHolder id="head" runat="server">
</asp:ContentPlaceHolder>

</head>

      

Any ideas?

+3


source to share


1 answer


You may be calling it before loading it from JavaScript files. Try to deform it withready



$(document).ready(function() {
   $('#CoappPersonalInformationForm.failureNotification').each(function () 
     {
        ValidatorEnable(this, false); 
     });
});

      

+3


source