不显眼的验证在ASP.NET母版页

时间:2015-08-22 02:20:23

标签: jquery asp.net

我正在Visual Studio ASP.Net C#中构建登录和注册页面。

当我尝试运行有问题的页面时,它崩溃并报告尽管页面链接到有引用它的母版页,但仍无法找到依赖于JQuery的不显眼的验证:

    <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">  

我尝试将引用更改为:

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

认为智能感知部分导致问题,但没有区别。

我应该补充一点,我使用自己的连接字符串连接到我的SQL Server数据库,而不是在服务器上创建数据库时提供的默认设置,而且我还没有连接到它,它可能是相关的:

  <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>

任何想法?

非常感谢。 千瓦

编辑:更多详情,感谢您的帮助:

以下是完整的错误消息文本:

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

0 个答案:

没有答案