Export (0) Print
Expand All

ScriptManager.EnablePageMethods Property

Gets or sets a value that indicates whether public static page methods in an ASP.NET page can be called from client script.

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

'Declaration
Public Property EnablePageMethods As Boolean
<asp:ScriptManager EnablePageMethods="True|False" />

Property Value

Type: System.Boolean
true if static page methods on an ASP.NET page can be called from client script as Web methods; otherwise, false. The default is false.

You can add static page methods to an ASP.NET page and mark them as Web methods. You can then call these methods from script as if they were part of a Web service, but without creating a separate .asmx file. To create Web methods on a page, import the System.Web.Services namespace and add a WebMethodAttribute attribute to each static method that you want to expose. The methods must be marked public.

For more information, see Exposing Web Services to Client Script in ASP.NET AJAX.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

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

Show:
© 2014 Microsoft