从用户配置文件中清除以前定义的所有属性和组。
此元素是 .NET Framework 2.0 版中的新元素。
??system.web 元素(ASP.NET 设置架构)
????profile 元素(ASP.NET 设置架构)
??????profile 的 properties 元素(ASP.NET 设置架构)
????????profile 的 properties 的 clear 元素(ASP.NET 设置架构)
<clear /> |
属性和元素
下面几部分描述了属性、子元素和父元素。
属性
无。
子元素
无。
父元素
元素 | 说明 |
---|---|
configuration |
指定公共语言运行库和 .NET Framework 应用程序所使用的每个配置文件中均需要的根元素。 |
system.web |
为 ASP.NET 配置节指定根元素。 |
profile |
为应用程序配置用户配置文件。 |
properties |
可选的元素。 定义用户配置文件属性和属性组的集合。 |
备注
有关访问和修改应用程序代码中 profile 元素的配置值的信息,请参见
示例
下面的代码示例演示如何使用 <clear> 元素在添加新配置文件属性之前清除任何现有的配置文件属性定义。
? | ![]() |
---|---|
<configuration> <connectionStrings> <add name="SqlServices" connectionString="Data Source=localhost;Integrated Security=SSPI;Initial Catalog=aspnetdb;" /> </connectionStrings> <system.web> <anonymousIdentification enabled="true" /> <profile defaultProvider="SqlProvider" > <providers> <add name="SqlProvider" connectionStringName="SqlServices" applicationName="HttpProfileBaseApplication" type="System.Web.Profile.SqlProfileProvider" /> </providers> <properties> <clear /> <add name="ZipCode" allowAnonymous="true" /> <add name="RecentSearchList" type="System.Collections.Specialized.StringCollection" serializeAs="Xml" allowAnonymous="true" /> </properties> </profile> </system.web> </configuration> |
元素信息
配置节处理程序 |
System.Web.Configuration.ProfileSection |
配置成员 |
|
可配置的位置 |
Machine.config 根级别的 Web.config 应用程序级别的 Web.config |
要求 |
Microsoft Internet 信息服务 (IIS) 版本 5.0、5.1 或 6.0 .NET Framework 2.0 版 Microsoft Visual Studio 2003 或 Visual Studio 2005 |
请参见
任务
参考
profile 的 properties 元素(ASP.NET 设置架构)profile 元素(ASP.NET 设置架构)
system.web 元素(ASP.NET 设置架构)
profile 的 properties 的 add 元素(ASP.NET 设置架构)
profile 的 properties 的 group 元素(ASP.NET 设置架构)
profile 的 properties 的 remove 元素(ASP.NET 设置架构)
概念
其他资源
ASP.NET 配置设置
常规配置设置 (ASP.NET)
