Search

.Net 4.5 RC breaks UnobtrusiveValidationMode by Eagle_f91

Closed
as By Design Help for as By Design

1
0
Sign in
to vote
Type: Bug
ID: 751330
Opened: 6/28/2012 9:09:39 AM
Access Restriction: Public
0
Workaround(s)
0
User(s) can reproduce this bug
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>
Details (expand)

Visual Studio/Team Foundation Server/.NET Framework Tooling Version

Visual Studio 2012 RC

What category (if any) best represents this feedback?

 

Steps to reproduce

Create a Forms Auth login control, protect a subfolder with the settings in above web.config, try to access page

Product Language

English

Operating System

Windows Server 2008 R2

Operating System Language

English

Actual results

Error page shows

Expected results

Page should render fine

Locale

 
File Attachments
0 attachments
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)
Sign in to post a workaround.