ASP登录帮助 [英] Asp login help

查看:110
本文介绍了ASP登录帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好

我对这样的事情还很陌生.

现在我对asp.net表单身份验证有疑问.
我想屏蔽来自用户的页面,所以我使用< deny users =?">在webconfig文件中.现在的问题是它将拒绝任何页面上的任何用户.但是我想让一些普通的非登录用户查看一些页面,例如说主页.我可以在任何地方列出他们可以看到的页面列表吗?

谢谢
Kev.

Hello

I am fairly new to anything like this.

Now i have a problem with asp.net form authentication.
I want to block pages from users and so i use <deny users="?"> in the webconfig file. Now the problem is it will deny any user on any page. but i want some normal non logged in users viewing some pages like say the homepage. Is there anywhere i can put a list of pages they can see?

Thx
Kev.

推荐答案

AFAIK,web.config不允许您指定单个文件访问权限,但实际上并不需要.
您可以(而且大多数站点都有)多个web.config文件-根目录中的主文件(拒绝访问未登录用户的文件),而其他文件夹中的简单文件允许访问未登录的用户的文件.
例如,我的根目录有一个web.config,它提供了我的连接字符串,等等,并且拒绝访问所有文件< deny users =?">.因此,它们将直接发送到login.aspx页面.
但是,我还有一个帮助"文件夹,其中包含一个更简单的web.config:
AFAIK, web.config does not allow you to specify individual file access rights, but you don''t really need to anyway.
You can (and most sites do) have multiple web.config files - a master one in the root which denies access to non-logged in users, and simpler ones in other folders which do allow access to non-logged in users.
For example, my root has a web.config giving my connection strings, blah de blah, and denying access to all files <deny users="?">. Thus, they are sent directly to the login.aspx page.
But, I also have a Help folder, with a simpler web.config:
<?xml version="1.0"?>
<configuration>
    <appSettings/>
    <system.web>
      <authorization>
        <allow users="*"/>
      </authorization>
    </system.web>
</configuration>

这允许未登录的用户访问我的常见问题解答,帮助页面等.
我的注册文件夹也有这个.

This allows unlogged users access to my FAQ, help pages and so on.
I also have this for the Registration folder.


这篇关于ASP登录帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆