Documentation for: ASP.NET Ajax Version 1.0

This documentation is for a previous version. For the current released version, see the ASP.NET Ajax documentation on MSDN.

 

 

 

 

 

 

 

ServiceReferenceCollection Class

Contains a set of ServiceReference objects.

Syntax

CSharp

[AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public class ServiceReferenceCollection : Collection<ServiceReference>

VisualBasic

<AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level := AspNetHostingPermissionLevel.Minimal)> _
<AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level := AspNetHostingPermissionLevel.Minimal)> _
Public Class ServiceReferenceCollection _
	Inherits Collection(Of ServiceReference)

ManagedCPlusPlus

[AspNetHostingPermissionAttribute(SecurityAction::LinkDemand, Level = AspNetHostingPermissionLevel::Minimal)]
[AspNetHostingPermissionAttribute(SecurityAction::InheritanceDemand, Level = AspNetHostingPermissionLevel::Minimal)]
public ref class ServiceReferenceCollection : public Collection<ServiceReference^>

JSharp

/** @attribute AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal) */
/** @attribute AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal) */
public class ServiceReferenceCollection extends Collection<ServiceReference>

Members

IconMemberDescription
ServiceReferenceCollectionNew()Initializes a new instance of the ServiceReferenceCollection class.
Add(ServiceReference)Adds an object to the end of the Collection. (Inherited from Collection<(Of ServiceReference>).)
Clear()Removes all elements from the Collection. (Inherited from Collection<(Of ServiceReference>).)
ClearItems()Removes all elements from the Collection. (Inherited from Collection<(Of ServiceReference>).)
Contains(ServiceReference)Determines whether an element is in the Collection. (Inherited from Collection<(Of ServiceReference>).)
CopyTo(ServiceReference[](), Int32)Copies the entire Collection to a compatible one-dimensional Array, starting at the specified index of the target array. (Inherited from Collection<(Of ServiceReference>).)
CountGets the number of elements actually contained in the Collection. (Inherited from Collection<(Of ServiceReference>).)
Equals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Finalize()Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
GetEnumerator()Returns an enumerator that iterates through the Collection. (Inherited from Collection<(Of ServiceReference>).)
GetHashCode()Serves as a hash function for a particular type. (Inherited from Object.)
GetType()Gets the Type of the current instance. (Inherited from Object.)
IndexOf(ServiceReference)Searches for the specified object and returns the zero-based index of the first occurrence within the entire Collection. (Inherited from Collection<(Of ServiceReference>).)
Insert(Int32, ServiceReference)Inserts an element into the Collection at the specified index. (Inherited from Collection<(Of ServiceReference>).)
InsertItem(Int32, ServiceReference)Inserts an element into the Collection at the specified index. (Inherited from Collection<(Of ServiceReference>).)
Item(Int32)Gets or sets the element at the specified index. (Inherited from Collection<(Of ServiceReference>).)
ItemsGets a IList wrapper around the Collection. (Inherited from Collection<(Of ServiceReference>).)
MemberwiseClone()Creates a shallow copy of the current Object. (Inherited from Object.)
Remove(ServiceReference)Removes the first occurrence of a specific object from the Collection. (Inherited from Collection<(Of ServiceReference>).)
RemoveAt(Int32)Removes the element at the specified index of the Collection. (Inherited from Collection<(Of ServiceReference>).)
RemoveItem(Int32)Removes the element at the specified index of the Collection. (Inherited from Collection<(Of ServiceReference>).)
SetItem(Int32, ServiceReference)Replaces the element at the specified index. (Inherited from Collection<(Of ServiceReference>).)
ToString()Returns a String that represents the current Object. (Inherited from Object.)

Remarks

The ServiceReferenceCollection object contains a ServiceReference object for each Web service that is registered in an ASP.NET AJAX page. Web services can be defined in the ScriptManager control or in an associated ScriptManagerProxy control.

You can add Web services to the ServiceReferenceCollection object declaratively by adding one or more <asp:ServiceReference> elements to a <Services> element inside the <asp:ScriptManager> element on the page, as shown in the following example.

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

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

Web services are registered with the ScriptManager control during the page's PreRender life cycle stage.

Permissions

  • AspNetHostingPermission

    for operating in a hosted environment. Demand value: LinkDemand. Associated enumeration: Minimal.

  • AspNetHostingPermission

    for operating in a hosted environment. Demand value: InheritanceDemand. Associated enumeration: Minimal.

Inheritance Hierarchy

Object

Assembly: System.Web.Extensions (Module: System.Web.Extensions)