高分求救!页面登陆验证后的跳转问题!
网站的用户在登陆页面在成功后,在开发的机器上可以跳转到指定的页面,可上传到服务器上以后却不能够跳转,而是跳转到网站的首页!下面是代码:主目录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;
谢谢各位了!
<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;
谢谢各位了!
...全文
相关推荐
开机面部识别
开机面部识别,系统安全登陆.用了就知道系统安全类
灵动校园_基于Android客户端的学生社交平台_发布活动与参与活动_支持活动上传图片_活动动态参与和评论_服务器推送消息_评价回复功能_用户登陆与活动分享_三方登陆和分享_短信验.zip
灵动校园_基于Android客户端的学生社交平台_发布活动与参与活动_支持活动上传图片_活动动态参与和评论_服务器推送消息_评价回复功能_用户登陆与活动分享_三方登陆和分享_短信验.zip
UniGUI集合说明
《模式识别与数据挖掘》配套PPT课件
《模式识别与数据挖掘》配套PPT课件
科技成果转化项目进场交易前,评估备案环节需要准备哪些材料?_8.docx
科易网基于AI模型+行业大数据,在技术转移、成果转化、技术经纪、知识产权、产业创新、科技招商等垂直领域的多样化应用场景,推出科技创新领域的AI+工具与数智化解决方案,推动科技创新与产业创新智能化发展。


