I have created an bootstrap website with a simple admin page for some results of the main page. Everything is working correctly on FireFox and Chrome, but when i'm trying to login via Internet Explorer, everytime I enter the credentials and click my login button, i'm keep getting redirected to the login page.
Web.config:
<!-- Authentication -->
<authentication mode="Forms">
<forms loginUrl="~/beheer/login.aspx" name=".ASPXFORMSAUTH" defaultUrl="~/beheer/default.aspx" path="beheer">
<credentials passwordFormat="Clear">
<!-- Login en wachtwoord -->
<user name="beheerder" password="beheerder"/>
</credentials>
</forms>
</authentication>
<authorization>
<allow users="*" />
<deny users="?" />
</authorization>
</system.web>
<!-- Toegangscontrole beheer overzicht -->
<location path="beheer">
<system.web>
<authorization>
<deny users="?" />
</authorization>
</system.web>
</location>
Global.asax:
static void RegisterRoutes(RouteCollection routes) {
routes.MapPageRoute("beheer", "beheer", "~/beheer/default.aspx");
} /* RegisterRoutes */
Login.aspx.cs:
protected void LoginButton_Click(object sender, EventArgs e) {
String LoginGebruikersnaam = NameTextBox.Text;
String LoginPaswoord = PasswordTextBox.Text;
if (FormsAuthentication.Authenticate(LoginGebruikersnaam, LoginPaswoord)) {
FormsAuthentication.RedirectFromLoginPage(LoginGebruikersnaam, this.RememberMeCheckBox.Checked);
} else {
this.FoutmeldingPlaceHolder.Visible = true;
}
} /* LoginButton_Click */
Does someone knows the answer to this?
解决方案:我必须将登录页面移动到网站的根目录。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.