我在/User目录下面放着与用户相关的页面,web.config里面设置: <authentication mode="Forms">
<forms path="/" name=".FormsAuthentication" loginUrl="Login.aspx" timeout="5256000" slidingExpiration="true">
</forms>
</authentication>
<location path="user">
<system.web>
<authorization>
<deny users="?" />
<allow users="*" />
</authorization>
</system.web>
</location>但是我发现一个奇怪的现象,大部分页面在登陆以后都可以正常访问,有些带有参数的页面,比如:Test.aspx?Id=555,在帐号[email protected]登陆的状态下可以正常访问,但是在帐号[email protected]登陆的状态下就不能访问,还是跳回到了登陆页面,而且再输入帐号[email protected]登陆还是不能成功。我将限制user登陆的web.config代码注释掉,在Test.aspx?Id=555中还设置了一段代码:FormsAuthenticationTicket ticket = FormsAuthentication.Decrypt(Request.Cookies[FormsAuthentication.FormsCookieName].Value);
FormsIdentity formsIdentity = new FormsIdentity(ticket);
if (formsIdentity.IsAuthenticated)
lblFormTest.Text = ticket.Name;在[email protected]帐号登陆的状态下,可以显示“[email protected]”,而在[email protected]帐号登陆的状态下,却显示:“An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. ”这个问题搞了一天了,真是郁闷。请各位帮忙。谢谢大家了。
<forms path="/" name=".FormsAuthentication" loginUrl="Login.aspx" timeout="5256000" slidingExpiration="true">
</forms>
</authentication>
<location path="user">
<system.web>
<authorization>
<deny users="?" />
<allow users="*" />
</authorization>
</system.web>
</location>但是我发现一个奇怪的现象,大部分页面在登陆以后都可以正常访问,有些带有参数的页面,比如:Test.aspx?Id=555,在帐号[email protected]登陆的状态下可以正常访问,但是在帐号[email protected]登陆的状态下就不能访问,还是跳回到了登陆页面,而且再输入帐号[email protected]登陆还是不能成功。我将限制user登陆的web.config代码注释掉,在Test.aspx?Id=555中还设置了一段代码:FormsAuthenticationTicket ticket = FormsAuthentication.Decrypt(Request.Cookies[FormsAuthentication.FormsCookieName].Value);
FormsIdentity formsIdentity = new FormsIdentity(ticket);
if (formsIdentity.IsAuthenticated)
lblFormTest.Text = ticket.Name;在[email protected]帐号登陆的状态下,可以显示“[email protected]”,而在[email protected]帐号登陆的状态下,却显示:“An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. ”这个问题搞了一天了,真是郁闷。请各位帮忙。谢谢大家了。
解决方案 »
- ExecuteReader: Connection 属性尚未初始化。谁帮我啊!!!高手救我啊!!!
- 在timer内的方法执行不起作用!!非常奇怪!!
- ■■■■■■■■■■■请问,如何做能让一个DIV层在不同屏幕分辨率下都紧贴文字左上方?
- 读取字符串的问题
- hyperlink绑定数据,当值时为空时怎么不显示这个hyperlink?
- 求一高手给解决个问题!很急!谢谢帮忙!
- 问个字符串的问题
- 重装系统后为什么运行不了以前的web程序?
- csdn和msdn的导航树是如何实现的
- 怎么获得ExecuteNonQuery()函数影响的行数
- GridView中帮定时间格式的数据的格式化问题
- 一个时间格式输出的问题
去掉试试
<authentication mode="Forms">
<forms path="/" name=".FormsAuthentication" loginUrl="Login.aspx" timeout="5256000" slidingExpiration="true">
</forms>
</authentication>
<authorization>
<allow users="*" />
</authorization>
</system.web> <location path="user">
<system.web>
<authorization>
<deny users="?" />
</authorization>
</system.web>
</location>