如何禁用“需要身份验证";弹出窗口? [英] How to disable "Authentication Required" pop up?
问题描述
我使用ASP.NET MVC 4
创建了一个Web应用程序,并将其上传到了商用Web服务器上.我的问题是,当我单击指向~/Account/LogOn
的操作链接时,会弹出"需要身份验证".
I created a Web Application Using ASP.NET MVC 4
, and uploaded it on a commercial web server. My problem is when I click the Actionlink pointing to ~/Account/LogOn
, an "Authentication Required" pop up appears.
这是我问题的开始,因为我不知道自己更改了哪些设置,或者是否有无法设置的设置?
This is the beginning of my problem because I don't know what settings I changed or is there a setting that I was not able to setup ?
在使用ASP.NET MVC 3之前,我已经创建了2个Web应用程序,并将其上传到同一台商用Web服务器上,并且运行良好.没有任何障碍.
I have created 2 Web Applications before Using ASP.NET MVC 3 and uploaded it on the same commercial web server and it runs perfectly. no hitches what-so-ever.
顺便说一句,他们给我的服务器访问权限不是远程桌面连接,而是它的Parallels.
By the way, the access they gave me to the server is not Remote Desktop Connection, its Parallels.
vipul.surana我无法发布图片,因为我的积分不足10分.因此,如果您满意,我将为您提供网站地址.网站地址为www.clktb.com,然后按右上角的登录.
vipul.surana I was not able to post a picture since I have less than 10 points. So, if it is ok with you I will give you the website address. The website address is www.clktb.com then press login found on the upper right part.
按请求的nwdev是我的web.config代码,除了删除连接字符串并从原始webconfig中删除了一些注释之外,我在这里没有做任何更改
nwdev as per request here is my web.config code I did not change anything here except removing connection string and removed some comments from the original webconfig
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<appSettings>
<add key="webpages:Version" value="2.0.0.0" />
<add key="webpages:Enabled" value="false" />
<add key="PreserveLoginUrl" value="true" />
<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
</appSettings>
<system.web>
<compilation debug="true" targetFramework="4.5">
<assemblies>
<add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</assemblies>
</compilation>
<httpRuntime targetFramework="4.5" />
<authentication mode="Forms">
<forms loginUrl="~/Account/Login" timeout="2880" />
</authentication>
<pages>
<namespaces>
<add namespace="System.Web.Helpers" />
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
<add namespace="System.Web.Optimization" />
<add namespace="System.Web.Routing" />
<add namespace="System.Web.WebPages" />
</namespaces>
</pages>
</system.web>
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<handlers>
<remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" />
<remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" />
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
<add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
<add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
</handlers>
</system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="DotNetOpenAuth.Core" publicKeyToken="2780ccd10d57b246" />
<bindingRedirect oldVersion="1.0.0.0-4.0.0.0" newVersion="4.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="DotNetOpenAuth.AspNet" publicKeyToken="2780ccd10d57b246" />
<bindingRedirect oldVersion="1.0.0.0-4.0.0.0" newVersion="4.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-1.3.0.0" newVersion="1.3.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
</entityFramework>
</configuration>
推荐答案
这是我的帐户/登录中已删除的代码.
This here is the removed code of my Account/LogOn.
根据达米恩·乔先生的话,我引用如果以后,那么您当前的网站项目肯定存在问题."由于它是由ASP.NET MVC 4预先制成的,因此我在LogOn的视图中仔细检查了代码,然后发现了一段不在MVC 3 LogOn中的代码
Based on the words of Mr. Damien Joe I Quote "If the later, then there is definitely an issue with your current website project." I double checked the codes in the VIEW of LogOn since it is premade by ASP.NET MVC 4 and I found a piece of code that is not in MVC 3 LogOn
<%--<p><%: Html.ActionLink("Register", "Register") %> if you don't have an account. </p>
<hr />
<section class="social" id="socialLoginForm">
<h2>Use another service to log in.</h2>
<%: Html.Action("ExternalLoginsList", new { ReturnUrl = ViewBag.ReturnUrl }) %>
</section>--%>
当我从查看所有内容"中删除这段代码时,它运行良好.如完美.我在这里用这段代码丢失了1天.希望将来人们会看到并知道该怎么做.
When I removed this piece of code from my View Everything worked perfectly. As in Perfectly. I lost 1 day with this piece of code right here. hopefully, in the future people will see this and know what to do.
这篇关于如何禁用“需要身份验证";弹出窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!