ScriptManager.Services Property


Gets a ServiceReferenceCollection object that contains a ServiceReference object for each Web service that ASP.NET exposes on the client for Ajax functionality.

 property System::Web::UI::ServiceReferenceCollection ^ Services { System::Web::UI::ServiceReferenceCollection ^ get(); };
public System.Web.UI.ServiceReferenceCollection Services { get; }
member this.Services : System.Web.UI.ServiceReferenceCollection
Public ReadOnly Property Services As ServiceReferenceCollection

Property Value



The ServiceReferenceCollection object that is returned by this property is a collection of ServiceReference objects, each of which represents a Web service that is registered with the ScriptManager control . You can define services in the ScriptManager control or in an associated ScriptManagerProxy control.

You can add services to the collection in markup by adding an asp:ServiceReference element to a Services element inside the asp:ScriptManager instance on the page, as shown in the following example.

<asp:ScriptManager ID="SM1" runat="server">  
    <asp:ServiceReference Path="Service.asmx" />  

You can also programmatically add a ServiceReference object to the Services collection by using the Add method of the ServiceReferenceCollection class.

Services are registered with the ScriptManager during the page's PreRender life-cycle stage.

Applies to