Asp.net 表单提交返回到登录屏幕
我有一个使用ASP.NET成员资格提供程序的ASP.NET MVC 1 web应用程序。在我的本地框中,当我向表单提交数据时,重定向会使用Controller.RedirectToRoute将数据带到正确的位置。在它应该存在的服务器上,表单提交会将我带回登录页面。数据发布正确,但我只是重定向错误 我记得几年前在一个非MVC应用程序中处理过这个问题,这是由于Web.Config与成员资格提供程序相关的一个问题 我无法想象我是唯一一个有这个问题的人。我应该在我的web.config中查找哪些可能与此相关的内容 提前谢谢 编辑 以下是web.config的身份验证和成员资格部分:Asp.net 表单提交返回到登录屏幕,asp.net,asp.net-mvc,web-config,asp.net-membership,Asp.net,Asp.net Mvc,Web Config,Asp.net Membership,我有一个使用ASP.NET成员资格提供程序的ASP.NET MVC 1 web应用程序。在我的本地框中,当我向表单提交数据时,重定向会使用Controller.RedirectToRoute将数据带到正确的位置。在它应该存在的服务器上,表单提交会将我带回登录页面。数据发布正确,但我只是重定向错误 我记得几年前在一个非MVC应用程序中处理过这个问题,这是由于Web.Config与成员资格提供程序相关的一个问题 我无法想象我是唯一一个有这个问题的人。我应该在我的web.config中查找哪些可能与此
<authentication mode="Forms">
<forms loginUrl="~/Account/LogOn" timeout="2880" />
</authentication>
<membership>
<providers>
<clear />
<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="ApplicationServices" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" passwordFormat="Hashed" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" passwordStrengthRegularExpression="" applicationName="IPS" />
</providers>
</membership>
<profile>
<providers>
<clear />
<add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="ApplicationServices" applicationName="IPS" />
</providers>
</profile>
<roleManager enabled="true">
<providers>
<clear />
<add connectionStringName="ApplicationServices" applicationName="IPS" name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add applicationName="IPS" name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</providers>
</roleManager>
如果您像使用用户数据存储一样使用MySQL,则会出现这种问题,因为本地pc和服务器上的MySQL连接器版本不同,MVC 1默认使用Forms auth。您可能需要检查表单身份验证设置,以确保您没有被重定向为安全性的一部分。事实并非如此。我正在使用本地托管的MS SQL Server。为什么-1?我在我的项目中遇到了这样的问题。当我在本地测试项目时——一切正常,但当发布到服务器时——身份验证不起作用。解决方案是将MySQL连接器更改为其他版本。很抱歉,发现了错误。我以为你在使用MySQLI发布了我的web.config文章,看看这是否有什么惊人之处?我发现了一个比我在这里提到的更深的问题。这个问题现在已经过时了。以下是我在事件日志中发现的新问题: