如何禁用“需要验证”弹出?

问题描述:

我使用ASP.NET MVC 4创建了一个Web应用程序,并将其上载到商用Web服务器上。我的问题是当我点击指向~/Account/LogOn的动作链接时,弹出窗口出现“身份验证”。如何禁用“需要验证”弹出?

这是我的问题的开始,因为我不知道我更改了哪些设置,或者是否存在无法设置的设置?

我在使用ASP.NET MVC 3之前创建了2个Web应用程序,并将其上载到同一个商业Web服务器上,并且运行完美。没有什么结果。

顺便说一句,他们给我的服务器的访问不是远程桌面连接,它的Parallels。

vipul.surana由于我不到10分,我无法发布图片。所以,如果你可以,我会给你的网站地址。网站地址是www.clktb.com,然后按右上角的登录按钮。这里

nwdev按要求就是我的web.config代码我没从原来的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> 
+0

你使用什么认证模式为你的应用程序?它必须设置为Windows身份验证。此外,允许在IIS中进行匿名身份验证。 –

+0

我正在使用Forms身份验证。我会尝试您的建议并使用Windows身份验证。我真的很喜欢在IIS中设置允许匿名身份验证,但由于我们的网络托管只是一个负担得起的,他们只让我们使用平行,有反正我可以在我的代码中添加它吗? –

+0

发布web.config代码 – mezmi

这这里是我的帐户/ Logon的移除代码。

基于Damien Joe先生的话我引用“如果以后,那么当前的网站项目肯定存在问题。”我双重检查的代码在Logon的意见是,由于它是由ASP.NET MVC 4预制,我发现了一段代码,是不是在MVC 3登录

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

当我删除这段代码从我查看一切正常。如在完美中。这段代码在这里丢失了一天。希望未来的人们会看到这一点,并知道该怎么做。

+0

很高兴你知道了,并得到了一切工作! –

+0

感谢您的输入达米安乔真的帮我指出了错误 –

+0

你受欢迎。如果你认为我的帖子很有帮助,你可以点击左边的箭头来上传它。谢谢。 –

您的身份验证模式设置为Forms改变任何东西,除了去除连接字符串,并删除了一些意见。除非必要,否则不要将其更改为Windows (Windows仅用于基于LAN的环境,其中用户由 Active Directory维护)。

我会检查您的网站文件夹的目录权限。转到您的网站文件夹&右键单击属性 - >安全&检查是否将已验证的用户添加到用户组。

另外,你使用的是web服务?

编辑 这很可能是您的网站文件夹的权限问题。 检查此链接的IIS http://support.microsoft.com/?id=258063 更多信息,也该线程ServerFault

+0

我没有使用webservices。我检查了所有经过身份验证的用户都已添加到用户组中 - 并且他们都已添加。 –

+0

@RodrigoBusa还检查该文件夹中包含的文件的类似权限。 –

+0

@RodrigoBusa更新了我的答案。 –