Export (0) Print
Expand All

WebScriptEnablingElement Class

Enables the WebScriptEnablingBehavior for an endpoint through configuration.

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

public sealed class WebScriptEnablingElement : BehaviorExtensionElement

The WebScriptEnablingElement is a BehaviorExtensionElement subtype that can be used to include the WebScriptEnablingBehavior on an endpoint through configuration. There are no configurable properties on this element.

The WebScriptEnablingBehavior, in turn, allows an endpoint to be accessed by ASP.NET AJAX Web pages when it is configured with the WebHttpBinding.

For more information about how to enable a WCF service to respond to ASP.NET AJAX clients, see Creating WCF Services for ASP.NET AJAX.

The following is an example of using this configuration element to configure a WCF endpoint to be accessed by ASP.NET AJAX Web page.

<system.serviceModel>
<services>
        <service name="Microsoft.Ajax.Samples.CalculatorService">
            <endpoint address=""
                behaviorConfiguration="AspNetAjaxBehavior" 
                binding="webHttpBinding"
                contract="Microsoft.Ajax.Samples.ICalculator" />
        </service>
    </services>
    <behaviors>
        <endpointBehaviors>
            <behavior name="AspNetAjaxBehavior">
                <enableWebScript />
            </behavior>
        </endpointBehaviors>
    </behaviors>
</system.serviceModel>

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:
© 2014 Microsoft