1

I'm building a login and signup pages in Visual Studio ASP.Net C#.

When I try to run the page in question its crashes and reports that the unobtrusive validation that relies on JQuery cannot be found despite the page being linked to a Master Page that has a reference to it:

    <form class="form1" runat="server">

        <%--Reference to jquery for all pages using MasterPage--%>
        <asp:ScriptManager ID="ScriptMan1" runat="server" EnablePageMethods="true">
    <Scripts>
   <asp:ScriptReference Path="~/scripts/jquery-2.1.4.intellisense.js" />

    </Scripts>
  </asp:ScriptManager>

        <div class="outer">
            <div class="top">  

I tried changing the reference to:

<asp:ScriptReference Path="~/scripts/jquery-2.1.4.js" />

Thinking that the intellisense part was causing a problem but it made no difference.

I should add that I have connected to my SQL Server database using my own connection string rather than the default setting provided that creates a DB on the server, and as I've yet to connect to that, it might be related:

  <connectionStrings>
    <!-- Disabled default setting <add name="DefaultConnection" providerName="System.Data.SqlClient" connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=aspnet-My Web Files-20150822010340;Integrated Security=SSPI" /> -->

    <add name="MyConnection" connectionString="Data Source = SQL.mywebserver.com; Initial Catalog=db_info; Persist Security Info=True; User ID =user_abc123; Password=p@55worD" providerName="System.Data.SqlClient"/>

  </connectionStrings>

Any Ideas?

Many thanks. Kw

Edit: More details, thanks for your help:

Here is the complete error message text:

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() +2179162
   System.Web.UI.WebControls.BaseValidator.RegisterUnobtrusiveScript() +10
   System.Web.UI.WebControls.BaseValidator.OnPreRender(EventArgs e) +9708897
   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.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.18408
Kwangle
  • 349
  • 2
  • 15
  • Can you please post the error message that you are getting? This will help diagnose the problem greatly. – idream1nC0de Aug 22 '15 at 02:29
  • Kwangle, did you check that the file is there? In the root folder of the project, do you see a scripts folder and inside that, do you see a jquery-2.1.4.js file? – Lajos Arpad Aug 22 '15 at 02:29
  • Check this link, there are options [similar post](http://stackoverflow.com/questions/731407/proper-way-to-use-jquery-when-using-masterpages-in-asp-net) – TheBrokenSpoke Aug 22 '15 at 04:39
  • Yes the Scripts folder is at the root of the site and has: jquery-2.1.4.intellisense.js, jquery-2.1.4.js, jquery-2.1.4.min.js and jquery-2.1.4.min.map. I assume these are all related as they were all installed at once. – Kwangle Aug 22 '15 at 06:31

0 Answers0