Twilight Soul

Alan McBee's personal web site
Welcome to Twilight Soul Sign in | Join | Help
in Search

ScriptHelper control

File Details
Downloads: 160 File Size: 7.1kB
Posted By: AlanM Views: 393
Date Added: 08-22-2007

This control is used to assist client-side script in finding ASP.NET nested controls. ASP.NET nested controls have ClientID values which are difficult to keep constant as web pages are edited. Often, the control itself will generate client-side script. Custom written client-side script that needs to refer to these controls, can be difficult to synchronize with the generated ClientIDs.

Place this control on the web page (or on a master page) and use it from within the Page code behind by calling its various Register... methods. These methods will either use the control's ID property (not its UniqueID or ClientID properties) as a key that will be used by the client-side script, so it's important to not register a control that may be rendered multiple times (such as in a templated, or repeating, control).

From the client-side script, global javascript objects will be created using names that can be changed using the ScriptHelper's properties. These objects will have properties named as the keys used in the Register... methods. The properties merely contain a string value which can then be used by other javascript (such as in calling the document.getElementById method).

Filed under: , , ,
Comments
No comments exist for this file.

Add Comment

(required) 
(required)
(optional)
(required) 
Add
Powered by Community Server (Non-Commercial Edition), by Telligent Systems