








默认情况,ASP.NET2.0没有开启匿名用户个性化设置,通过Web.config设置,可以实现对匿名用户的支持。
Web.config设置
<?xml version="1.0"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<appSettings/>
<connectionStrings/>
<system.web>
<anonymousIdentification enabled="true"/>
<profile>
<properties>
<add name="Name" allowAnonymous="true" />
<add name="LastSubmit" type="System.DateTime" allowAnonymous="true"/>
<group name="Address">
<add name="City" allowAnonymous="true"/>
<add name="ZipCode" allowAnonymous="true"/>
</group>
</properties>
</profile>
<compilation debug="true"/>
<authentication mode="Windows"/>
</system.web>
</configuration>
anonymousIdentification:针对应用程序授权配置匿名标识。这是在需要授权时,对没有经过身份验证的实体进行标识所必需的。
allowAnonymous必须设置为"True"。
Default.aspx.cs
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。