Share via


ProfileManager.AutomaticSaveEnabled 属性

定义

获取一个值,该值指示是否将在 ASP.NET 页执行结束时自动保存用户配置文件。

public:
 static property bool AutomaticSaveEnabled { bool get(); };
public static bool AutomaticSaveEnabled { get; }
static member AutomaticSaveEnabled : bool
Public Shared ReadOnly Property AutomaticSaveEnabled As Boolean

属性值

如果在 ASP.NET 页执行结束时自动保存用户配置文件,则为 true;否则为 false。 默认值为 true

例外

在不具有起码的 AutomaticSaveEnabled 权限的情况下尝试获取 Medium 属性值。

示例

以下配置文件摘录显示了 ASP.NET 应用程序的Web.config文件的 system.web 部分中的配置文件元素。 它将应用程序的默认配置文件提供程序指定为 SqlProfileProvider 实例, automaticSaveEnabled 并将 属性设置为 true

<profile enabled="true"
  automaticSaveEnabled="true"
  defaultProvider="SqlProvider">
  <providers>
    <add name="SqlProvider"
      type="System.Web.Profile.SqlProfileProvider"
      connectionStringName="SqlServices"
      applicationName="MyApplication" />
  </providers>
</profile>

注解

属性 AutomaticSaveEnabled 指示是否为应用程序启用用户配置文件的自动保存。 如果启用了自动保存,则 对象将在ProfileModuleProfileAutoSaving执行 ASP.NET 页结束时引发 事件并调用 Save 方法EndRequest

属性 AutomaticSaveEnabled 是使用 automaticSaveEnabled ASP.NET 应用程序的 Web.config 文件中 配置文件 元素的 属性设置的。

适用于

另请参阅