比如,跟目录下面有:1.asp,2.aspx,3.aspx。
我喜欢请求1.asp,2.aspx不需要登陆。请求3.aspx则需要登陆?
如果不能够通过web.config来实现。通过代码我如何实现?
我做了一个用户控件,没有任何显示内容,是用来控制登陆的
代码是
if(System.Web.HttpContext.Current.User.Identity.IsAuthenticated)
{
Server.Transfer("Account.aspx?ShowPanel=Login");
}
可是,它不工作。
有没有其他解决方案啊?
我喜欢请求1.asp,2.aspx不需要登陆。请求3.aspx则需要登陆?
如果不能够通过web.config来实现。通过代码我如何实现?
我做了一个用户控件,没有任何显示内容,是用来控制登陆的
代码是
if(System.Web.HttpContext.Current.User.Identity.IsAuthenticated)
{
Server.Transfer("Account.aspx?ShowPanel=Login");
}
可是,它不工作。
有没有其他解决方案啊?
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>这样2.aspx就不需要登陆就可访问
http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q316871