开发者

Need to show pages without logging in (asp.net)

I am using

<authentication mode="Forms" >
  <forms loginUrl=开发者_开发知识库"login.aspx"
    name=".ASPXFORMSAUTH"  />
</authentication>

Every thing works fine except that, there are some pages like About Us, Contact Us, Privacy Policy etc, which do not need to login to view them.

In my case i need to login to view all pages. I want these common pages to be viewable without having to log on.

I have tested my application on local IIS as well as on deployment server, but same problem occurs.

Please help!

Thanks for sharing your valuable time.


You need to create exceptions to your security policy:

<!-- files in the "Public" folder don't require authorization -->
<location path="Public">
    <system.web>
        <authorization>
            <allow users="*"/>
        </authorization>
    </system.web>
</location>

Alternately, you can make page-specific exceptions:

<location path="AboutUs.aspx">
    <system.web>
        <authorization>
            <allow users="*"/>
        </authorization>
    </system.web>
</location>


Appearantly you want some pages to be available without logging in. The way to go about this is to set permission on subdirectories instead of the website root, and put these pages in the web root (usually they are in teh root)

If thats too much work, put your pages in a directory and allow anonymous users to access it.


There could be a large number of possible answers to such an open question. We will need more specifics to answer. Here are just a few places to look:

Have you checked your web.config file to see if anonymous authentication is off?

Have you checked the web.config to see if you are denying anonymous users access to your root directory?

Have you checked IIS to see if anonymous authentication is off?

Have you checked the pages' source code files to see if you are doing manual denial of service to anonymous users?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜