EnablePageMethods Property

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)

public bool EnablePageMethods { get; set; }

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 .fe3f6e9e-0acd-44c9-bf0f-0a8598fc13b8

.NET Framework
Available since 3.5
Return to top
© 2015 Microsoft