高分求救!页面登陆验证后的跳转问题!
网站的用户在登陆页面在成功后,在开发的机器上可以跳转到指定的页面,可上传到服务器上以后却不能够跳转,而是跳转到网站的首页!下面是代码:主目录web.config的配置
<authentication mode="Forms">
<forms loginUrl="HotelManageLoginPage.aspx" timeout="40" name="wangyixing" protection="All" path="/">
<credentials passwordFormat="Clear">
<user name = "***" password="***"></user>
</credentials>
</forms>
</authentication>
需要登陆才能访问的页面的web.config的配置:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<authorization>
<deny users="?" />
</authorization>
</system.web>
</configuration>
登陆按钮的代码:
if (FormsAuthentication.Authenticate(this.txt_UserID.Text.Trim(), this.txt_Password.Text.Trim()))
{
FormsAuthentication.RedirectFromLoginPage(this.txt_UserID.Text.Trim(), Remember.Checked);
Response.Redirect(@"\Hotel\BackGround\BackManageIndexPage.aspx"); //跳转到此页
}
else
{
Page.RegisterStartupScript("","<script language=javascript>window.alert('错误的用户名称和密码!');</script>");
}
登陆成功后加载页的窗体加载代码:
FormsIdentity identity=(FormsIdentity)User.Identity;
谢谢各位了!