ScriptingProfileServiceSection Class
TOC
Collapse the table of content
Expand the table of content

ScriptingProfileServiceSection Class

Represents the configuration section for profile-service settings. This class cannot be inherited.

Namespace:  System.Web.Configuration
Assembly:  System.Web.Extensions (in System.Web.Extensions.dll)

[AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public sealed class ScriptingProfileServiceSection : ConfigurationSection

The ScriptingProfileServiceSection class enables you to programmatically access and modify the profileService element of the configuration section for ASP.NET applications that use AJAX functionality.

The profile service is used to get and set profile properties for the user identity that is associated with the current request. This means that the profile service works for authenticated users. It also works for anonymous users when the anonymous identification feature is enabled (or available) in the configuration file.

The following example shows how to declaratively specify values for properties of the ScriptingProfileServiceSection class in a configuration file.

<system.web.extensions>
  <scripting>
    <webServices>
      <profileService enabled="true" 
        readAccessProperties="FirstName,LastName" 
        writeAccessProperties="FirstName,LastName" />
    </webServices>
  </scripting>
</system.web.extensions>

The following example shows how to access the ScriptingProfileServiceSection section programmatically.

// Get the Web application configuration.
System.Configuration.Configuration configuration =
    WebConfigurationManager.OpenWebConfiguration("/aspnetTest");

// Get the external Web services section.
ScriptingWebServicesSectionGroup webServicesSection =
    (ScriptingWebServicesSectionGroup)configuration.GetSectionGroup(
    "system.web.extensions/scripting/webServices");

// Get the profile service section.
ScriptingProfileServiceSection profileSection =
    webServicesSection.ProfileService;

System.Object
  System.Configuration.ConfigurationElement
    System.Configuration.ConfigurationSection
      System.Web.Configuration.ScriptingProfileServiceSection

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5

Community Additions

ADD
Show:
© 2016 Microsoft