我在根目录web.config里设置如下
<authentication mode="Forms">
<forms name=".aspnet" loginUrl="User/Login.aspx" defaultUrl="index.aspx" timeout="60" path="/">
</forms>
</authentication>
这个是用于用户没登陆就条到用户的登陆页面的我有个目录是admin 我这个目录下的web.config里该怎么样设置实现如下功能?我直接把下面的放进去要出错
<authentication mode="Forms">
<forms name=".aspnet" loginUrl="Admin/Login.aspx" defaultUrl="~/admin/index.aspx" timeout="60" path="/">
</forms>
</authentication>想实现用于管理员没登陆就条到管理员的登陆页面的请问该怎么样实现?
<authentication mode="Forms">
<forms name=".aspnet" loginUrl="User/Login.aspx" defaultUrl="index.aspx" timeout="60" path="/">
</forms>
</authentication>
这个是用于用户没登陆就条到用户的登陆页面的我有个目录是admin 我这个目录下的web.config里该怎么样设置实现如下功能?我直接把下面的放进去要出错
<authentication mode="Forms">
<forms name=".aspnet" loginUrl="Admin/Login.aspx" defaultUrl="~/admin/index.aspx" timeout="60" path="/">
</forms>
</authentication>想实现用于管理员没登陆就条到管理员的登陆页面的请问该怎么样实现?
解决方案 »
- 在asp.net中,如何在后台将数据写入到xml的指定位置(第一项),请高手们进来帮我看看,小弟万分感谢!!!
- <input type="radio" />
- 【超简单】页面自动加载
- 安装visual stuido.net 2005无法使用数据库
- 问个低技术含量问题: sqlserver数据库内一个表的列的数据类型为varbinary,要从页面textbox的值存入这个列,数据类型怎么转化?
- 这样更新,什么传值传不了,大家帮忙看看
- 如何随机4位数字
- 关于摸板页的问题[非常急]
- 如何用DataSet返回两张表
- |zyciis| 如何在一段文件内取包含有指定字符的内容
- 一个程序员骗子QQ大家千万不要和他有什么往来!!
- 两个爱我的女孩我到底要爱哪一个?别让我走入歧途,进来帮帮我吧,虽然没有多少积分可供!
http://hi.baidu.com/meilixueshan/blog/item/9cc7024ca3030fffd72afc37.html
将<session name="autoentication"节点下的allowDefinition属性设为"Everywhere"
<authorization>
<deny users="?"/>
</authorization>
<location path="path"> <!--path可以某个目录也可以是具体的文件-->
<system.web>
<authorization>
……
</authorization>
<authentication mode="Forms">
……
</authentication>
</system.web>
</location>
我这样
<location path="~/admin">
<!--path可以某个目录也可以是具体的文件-->
<system.web>
<authentication mode="Forms">
<forms name=".aspnet" loginUrl="Admin/Login.aspx" defaultUrl="~/admin/index.aspx" timeout="60" path="/">
</forms>
</authentication>
</system.web>
</location>
还是不行了`访问admin目录里的aspx还是条到了用户登陆页面```
<allow roles="ADMIN" />
<deny users="*"/>
</authorization>
加了这个的