需要在不登录的情况下显示页面(asp.net)
我正在使用
<authentication mode="Forms" >
<forms loginUrl="login.aspx"
name=".ASPXFORMSAUTH" />
</authentication>
一切正常,除了有一些页面,如关于我们、联系我们、隐私政策等,不需要登录即可查看。
就我而言,我需要登录才能查看所有页面。我希望无需登录即可查看这些常见页面。
我已经在本地 IIS 和部署服务器上测试了我的应用程序,但出现了同样的问题。
请帮忙!
感谢您分享您的宝贵时间。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您需要为安全策略创建例外:
或者,您可以创建特定于页面的例外:
You need to create exceptions to your security policy:
Alternately, you can make page-specific exceptions:
显然,您希望某些页面无需登录即可使用。解决此问题的方法是在子目录而不是网站根目录上设置权限,并将这些页面放在网络根目录中(通常它们位于根目录中)
如果这太多了工作时,将您的页面放入目录中并允许匿名用户访问它。
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.
对于这样一个悬而未决的问题,可能有很多可能的答案。我们需要更多细节来回答。以下是一些需要查看的地方:
您是否检查过 web.config 文件以查看匿名身份验证是否已关闭?
您是否检查过 web.config 以查看是否拒绝匿名用户访问您的根目录?
您是否检查过 IIS 以查看匿名身份验证是否已关闭?
您是否检查过页面的源代码文件以查看是否对匿名用户进行手动拒绝服务?
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?