.Net 4.5 RC breaks UnobtrusiveValidationMode - by Eagle_f91

Status : 

  By Design<br /><br />
		The product team believes this item works according to its intended design.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.


2
0
Sign in
to vote
ID 751330 Comments
Status Closed Workarounds
Type Bug Repros 0
Opened 6/28/2012 9:09:39 AM
Access Restriction Public

Description

After upgrading to .Net 4.5 RC on my Dev machine I get the following error on my LoginPage using Forms Authentication

Server Error in '/' Application.
--------------------------------------------------------------------------------

WebForms UnobtrusiveValidationMode requires a ScriptResourceMapping for 'jquery'. Please add a ScriptResourceMapping named jquery(case-sensitive). 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.InvalidOperationException: WebForms UnobtrusiveValidationMode requires a ScriptResourceMapping for 'jquery'. Please add a ScriptResourceMapping named jquery(case-sensitive).

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

Stack Trace: 


[InvalidOperationException: WebForms UnobtrusiveValidationMode requires a ScriptResourceMapping for 'jquery'. Please add a ScriptResourceMapping named jquery(case-sensitive).]
   System.Web.UI.ClientScriptManager.EnsureJqueryRegistered() +222
   System.Web.UI.WebControls.BaseValidator.OnPreRender(EventArgs e) +233
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +256
   System.Web.UI.Control.PreRenderRecursiveInternal() +256
   System.Web.UI.Control.PreRenderRecursiveInternal() +256
   System.Web.UI.Control.PreRenderRecursiveInternal() +256
   System.Web.UI.Control.PreRenderRecursiveInternal() +256
   System.Web.UI.Control.PreRenderRecursiveInternal() +256
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4048
 

I have tried setting the ValidationSettings:UnobtrusiveValidationMode to WebForms in both the web.config file and in the global.asax but still get the error.

web.config code:
<?xml version="1.0"?>
<configuration>

  <appSettings>
      <add key="ValidationSettings:UnobtrusiveValidationMode" value="WebForms" />
  </appSettings>

    <system.web>
      <authorization>
        <deny roles="Fan" />
        <deny users="?" />
      </authorization>
    </system.web>

    <location path="elmah.axd">
        <system.webServer>
            <handlers>
                <add name="ELMAH"
                     verb="POST,GET,HEAD"
                     path="elmah.axd"
                     type="Elmah.ErrorLogPageFactory, Elmah"
                     preCondition="integratedMode" />
            </handlers>
        </system.webServer>
    </location>
    
</configuration>

global.asax
<%@ Application Language="C#" %>
<%@ Import Namespace="System.Web.Routing" %>

<script runat="server">

    void Application_Start(object sender, EventArgs e)
    {
        System.Web.UI.ValidationSettings.UnobtrusiveValidationMode = UnobtrusiveValidationMode.WebForms;
        RegisterRoutes(RouteTable.Routes);
    }

    private static void RegisterRoutes(RouteCollection Routes)
    {
    }
       
</script>
Sign in to post a comment.
Posted by Microsoft on 6/29/2012 at 1:27 AM
Thanks for your feedback.
We are happy that your issue has been resolved.According to your description we will close the case.If you have another issue in future, please contact to us.

Thank you,
Microsoft Visual Studio Connect Support Team
Posted by Eagle_f91 on 6/28/2012 at 10:56 AM
http://connect.microsoft.com/VisualStudio/feedback/details/735928/in-asp-net-web-application-visual-basic-the-requiredfieldvalidator-doest-work

Has a fix, I miss read that the first time, I need to REMOVE

<add key="ValidationSettings:UnobtrusiveValidationMode" value="WebForms" />

from my web.config. Sorry about that
Posted by Microsoft on 6/28/2012 at 9:49 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)