5 Replies - 7411 Views - Last Post: 01 November 2013 - 09:05 AM

#1 aidenkael  Icon User is offline

  • D.I.C Head

Reputation: 6
  • View blog
  • Posts: 65
  • Joined: 22-October 13

UnobtrusiveValidationMode?

Posted 26 October 2013 - 11:28 AM

Hey all, I get this error upon testing my webpage:

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() +2280926
System.Web.UI.WebControls.BaseValidator.RegisterUnobtrusiveScript() +10
System.Web.UI.WebControls.BaseValidator.OnPreRender(EventArgs e) +9639589
System.Web.UI.Control.PreRenderRecursiveInternal() +83
System.Web.UI.Control.PreRenderRecursiveInternal() +155
System.Web.UI.Control.PreRenderRecursiveInternal() +155
System.Web.UI.Control.PreRenderRecursiveInternal() +155
System.Web.UI.Control.PreRenderRecursiveInternal() +155
System.Web.UI.Control.PreRenderRecursiveInternal() +155
System.Web.UI.Control.PreRenderRecursiveInternal() +155
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +974




Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.33440

Now, everything worked fine, right up until I added this line of code:
<asp:RequiredFieldValidator Class="error" ID="rfv_name" ControlToValidate="txt_name" Text="Please Enter a Value" runat="server" />


Anyone know what it is? I don't have an jQuery elements in my code, and am using VS 2013 if that helps.

Here is the full Panel of code:
<asp:Panel ID="pnl_bugform" runat="server">
        <form method="post" runat="server">
            <asp:Label ID="lbl_name" Text="Your Name" runat="server" />
            <asp:TextBox ID="txt_name" width="250px" runat="server" />
            <asp:RequiredFieldValidator Class="error" ID="rfv_name" ControlToValidate="txt_name" Text="Please Enter a Value" runat="server" />
            <br /><br />
            <asp:Button ID="btn_submit" runat="server" Text="Submit" onclick="btn_submit_Click" />
        </form>
    </asp:Panel>


Is This A Good Question/Topic? 0
  • +

Replies To: UnobtrusiveValidationMode?

#2 h4nnib4l  Icon User is offline

  • The Noid
  • member icon

Reputation: 1181
  • View blog
  • Posts: 1,673
  • Joined: 24-August 11

Re: UnobtrusiveValidationMode?

Posted 01 November 2013 - 07:13 AM

Try adding the following to the root (Configuration) node of your web.config file:

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



Here's the MSDN Article (it's the last entry), and a few more from CodePlex and StackOverflow. They'll tell you to do the same thing, but contain more info.

This post has been edited by h4nnib4l: 01 November 2013 - 08:45 AM

Was This Post Helpful? 1
  • +
  • -

#3 aidenkael  Icon User is offline

  • D.I.C Head

Reputation: 6
  • View blog
  • Posts: 65
  • Joined: 22-October 13

Re: UnobtrusiveValidationMode?

Posted 01 November 2013 - 07:51 AM

View Posth4nnib4l, on 01 November 2013 - 09:13 AM, said:

Try adding the following to the root (Configuration) node of your web.config file:

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



Here's the MSDN Article (it's the last entry), and a few more from CodePlex and StackOverflow. They'll tell you to do the same thing, but contain more info.


That worked! Of all the forms I've built, I have never had to do that.... Maybe something changed in VS 2013? First asp project I've done in 2013 and first time this has happened.... Well it's working now! :bananaman:
Was This Post Helpful? 0
  • +
  • -

#4 h4nnib4l  Icon User is offline

  • The Noid
  • member icon

Reputation: 1181
  • View blog
  • Posts: 1,673
  • Joined: 24-August 11

Re: UnobtrusiveValidationMode?

Posted 01 November 2013 - 08:47 AM

Which version of .NET are you targetting? From the limited amount of research I did, it seems to be related to targeting older versions of the framework from projects in the newer Visual Studios, perhaps due to a lack of support for HTML5 features in older versions of the framework. Anyway, glad it's working for you now!
Was This Post Helpful? 0
  • +
  • -

#5 aidenkael  Icon User is offline

  • D.I.C Head

Reputation: 6
  • View blog
  • Posts: 65
  • Joined: 22-October 13

Re: UnobtrusiveValidationMode?

Posted 01 November 2013 - 08:51 AM

View Posth4nnib4l, on 01 November 2013 - 10:47 AM, said:

Which version of .NET are you targetting? From the limited amount of research I did, it seems to be related to targeting older versions of the framework from projects in the newer Visual Studios, perhaps due to a lack of support for HTML5 features in older versions of the framework. Anyway, glad it's working for you now!


Nope targeting 4.5.... I have been having weird issues with 2013 all day though. Now it crashes anytime you type a character after a #. Makes changing my .css inside VS impossible.

  <system.web>
    <compilation debug="true" targetFramework="4.5" />
    <httpRuntime targetFramework="4.5" />
  </system.web>

Was This Post Helpful? 0
  • +
  • -

#6 h4nnib4l  Icon User is offline

  • The Noid
  • member icon

Reputation: 1181
  • View blog
  • Posts: 1,673
  • Joined: 24-August 11

Re: UnobtrusiveValidationMode?

Posted 01 November 2013 - 09:05 AM

Well, scratch that then. But I'll keep an eye out for this next time a build a web app.

This post has been edited by h4nnib4l: 01 November 2013 - 09:05 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1