Asp.net登录控件不起作用 [英] Asp.net login control doesn't work

查看:104
本文介绍了Asp.net登录控件不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我将ASP.net控件添加到我的页面并运行该网站时,我收到此错误:



 WebForms UnobtrusiveValidationMode需要ScriptResourceMapping for 'jQuery的'。请添加一个名为jquery的ScriptResourceMapping(区分大小写)。





有什么问题?



请通知我。



我的尝试:



< pre>< asp:Content ID =Content2ContentPlaceHolderID =ContentPlaceHolder1Runat =Server> 
< asp:登录ID =Login1runat =server>< / asp:登录>
< asp:Button ID =Button1runat =serverText =Button/>
< / asp:Content>

解决方案

此问题已在其他论坛上得到解答,因为快速谷歌搜索显示我有这些,并且有多种解决方案。



你需要的是在Applicationo_Start后面的Global.asax代码中执行以下操作:



 受保护  void  Application_Start(< span class =code-keyword> object  sender,EventArgs e)
{
string JQueryVer = 1.7.1;
ScriptManager.ScriptResourceMapping.AddDefinition( jquery new ScriptResourceDefinition
{
Path = 〜/ Scripts / jquery- + JQueryVer + .min.js
DebugPath = < span class =code-string> 〜/ Scripts / jquery - + JQueryVer + 。js
CdnPath = http://ajax.aspnetcdn.com/ajax/jQuery/jquery- + JQueryVer + .min.js
CdnDebugPath = http://ajax.aspnetcdn。 com / ajax / jQuery / jquery - + JQueryVer + 。js
CdnSupportsSecureConnection = true
LoadSuccessExpression = window.jQuery
});
}





您可能想了解更多详情此处


When I add ASP.net control to my page and run the site I get this error:

WebForms UnobtrusiveValidationMode requires a ScriptResourceMapping for 'jquery'. Please add a ScriptResourceMapping named jquery(case-sensitive).



What is wrong?

Please inform me.

What I have tried:

<pre><asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:Login ID="Login1" runat="server"></asp:Login>
    <asp:Button ID="Button1" runat="server" Text="Button" />
</asp:Content>

解决方案

This question is already answered on a different forum as a quick google search revealed me those, and there are multiple solutions to this.

what you need is to do following in Global.asax code behind in Applicationo_Start:

protected void Application_Start(object sender, EventArgs e)
{
    string JQueryVer = "1.7.1";
    ScriptManager.ScriptResourceMapping.AddDefinition("jquery", new ScriptResourceDefinition
    {
        Path = "~/Scripts/jquery-" + JQueryVer + ".min.js",
        DebugPath = "~/Scripts/jquery-" + JQueryVer + ".js",
        CdnPath = "http://ajax.aspnetcdn.com/ajax/jQuery/jquery-" + JQueryVer + ".min.js",
        CdnDebugPath = "http://ajax.aspnetcdn.com/ajax/jQuery/jquery-" + JQueryVer + ".js",
        CdnSupportsSecureConnection = true,
        LoadSuccessExpression = "window.jQuery"
    });
}



You may want to read more details here


这篇关于Asp.net登录控件不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆