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.

 

 

 

 

 

 

 

Skip Navigation Links.
ScriptManager Class
ScriptManager Constructor
AllowCustomErrorsRedirect Property
AsyncPostBackError Event
AsyncPostBackErrorMessage Property
AsyncPostBackSourceElementID Property
AsyncPostBackTimeout Property
AuthenticationService Property
EnablePageMethods Property
EnablePartialRendering Property
EnableScriptGlobalization Property
EnableScriptLocalization Property
GetCurrent Method (page)
IsDebuggingEnabled Property
IsInAsyncPostBack Property
LoadPostData Method (postDataKey, postCollection)
LoadScriptsBeforeUI Property
OnAsyncPostBackError Method (e)
OnInit Method (e)
OnPreRender Method (e)
OnResolveScriptReference Method (e)
ProfileService Property
RaisePostDataChangedEvent Method
RegisterArrayDeclaration Method
RegisterArrayDeclaration Method (control, arrayName, arrayValue)
RegisterArrayDeclaration Method (page, arrayName, arrayValue)
RegisterAsyncPostBackControl Method (control)
RegisterClientScriptBlock Method
RegisterClientScriptBlock Method (control, type, key, script, addScriptTags)
RegisterClientScriptBlock Method (page, type, key, script, addScriptTags)
RegisterClientScriptInclude Method
RegisterClientScriptInclude Method (control, type, key, url)
RegisterClientScriptInclude Method (page, type, key, url)
RegisterClientScriptResource Method
RegisterClientScriptResource Method (control, type, resourceName)
RegisterClientScriptResource Method (page, type, resourceName)
RegisterDataItem Method
RegisterDataItem Method (control, dataItem)
RegisterDataItem Method (control, dataItem, isJsonSerialized)
RegisterDispose Method (control, disposeScript)
RegisterExpandoAttribute Method (control, controlId, attributeName, attributeValue, encode)
RegisterExtenderControl Method (extenderControl, targetControl)
RegisterHiddenField Method
RegisterHiddenField Method (control, hiddenFieldName, hiddenFieldInitialValue)
RegisterHiddenField Method (page, hiddenFieldName, hiddenFieldInitialValue)
RegisterOnSubmitStatement Method
RegisterOnSubmitStatement Method (control, type, key, script)
RegisterOnSubmitStatement Method (page, type, key, script)
RegisterPostBackControl Method (control)
RegisterScriptControl Method (scriptControl)
RegisterScriptDescriptors Method
RegisterScriptDescriptors Method (extenderControl)
RegisterScriptDescriptors Method (scriptControl)
RegisterStartupScript Method
RegisterStartupScript Method (control, type, key, script, addScriptTags)
RegisterStartupScript Method (page, type, key, script, addScriptTags)
Render Method (writer)
ResolveScriptReference Event
ScriptMode Property
ScriptPath Property
Scripts Property
Services Property
SetFocus Method
SetFocus Method (clientID)
SetFocus Method (control)
SupportsPartialRendering Property
Visible Property

RegisterDispose Method (control, disposeScript)

Registers a dispose script for a control that is inside an UpdatePanel control. The script is executed when the UpdatePanel control is updated or deleted. This method is used for client components that are part of the Microsoft AJAX Library and need to free resources when a component is no longer used.

Syntax

CSharp

public void RegisterDispose (
	Control control,
	string disposeScript
)

VisualBasic

Public Sub RegisterDispose ( _
	control As Control, _
	disposeScript As String _
)

ManagedCPlusPlus

public:
void RegisterDispose (
	Control^ control, 
	String^ disposeScript
)

JSharp

public void RegisterDispose (
	Control control,
	String disposeScript
)

Parameters

control (Control)

The control that the dispose script is for.

disposeScript (String)

A string that contains the dispose script.

Remarks

Use the RegisterDispose(Control, String) method to register dispose scripts for controls that are inside an UpdatePanel control. During asynchronous postbacks, UpdatePanel controls can be updated, deleted, or created. When a panel is updated or deleted, any dispose scripts that are registered for controls that are inside the UpdatePanel are called. In typical page development scenarios, you will not need to use the RegisterDispose(Control, String) method.

The RegisterDispose(Control, String) method is intended for use by control developers to register script or create controls that inherit from the IScriptControl interface. For example, you might use a dispose script if you develop client controls by using composition. In your control, you implement IScriptControl and render individual controls. You register the dispose method of any item that does not correspond to a defined client component such as Sys.TextBox. If your custom control composes elements that correspond to client components in the Microsoft AJAX Library, you do not need to register a dispose script, because dispose is called automatically.

The RegisterDispose(Control, String) method can be called multiple times for a control. Multiple scripts are aggregated. The order of disposing scripts matches the order in which the scripts were registered.

If you register a dispose script for a control that is not in an UpdatePanel control, an exception is thrown. The dispose script is called between the pageLoading and pageLoaded events of the PageRequestManager class.

Exceptions

ExceptionCondition
ArgumentNullException

control is null.

- or -

disposeScript is null.

ArgumentException

control is not found on the page.

- or -

control is not inside an UpdatePanel control.

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