Version

AddScriptBlock Method

Add javascript statements which will be executed on the client at the end of asynchronous response.
Syntax
'Declaration
 
Public Shared Function AddScriptBlock( _
   ByVal page As Page, _
   ByVal ownerOfAsyncPostBack As Control, _
   ByVal javaScript As String _
) As Boolean
public static bool AddScriptBlock( 
   Page page,
   Control ownerOfAsyncPostBack,
   string javaScript
)

Parameters

page
Reference to Page.
ownerOfAsyncPostBack
If it is not null and it is not the owner of asynchronous postback, then script is not added. If that parameter is null, then script is added regardless of the owner of postback.
javaScript
Javascript statements.

Return Value

True: script block was added, false: script block was not added.
Remarks

That can be used to pass any javascript data to client.

Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also