Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to encapsulate DHTML code into components?

Status
Not open for further replies.

VJay

Programmer
Mar 26, 2002
19
IN
DHTML is basically client side scripting, Can you please tell me if it possible to encapsulate the DHTML code into components in ASP.NET
Thanks in Advance
 
Your question isn't very clear.
If you want to add DHTML to certain server control's events or properties, you can use it's Attributes collection:

myControl.Attributes.Add("onclick", "alert('hello world');")

If you want to add functions or code to other controls (client controls) use the HTML view to add your client code.

Hope this helps.
NetAngel
 
If you want to include script blocks, try this:

Page.RegisterClientScriptBlock(strScriptName, strScript)

The first param is used to describe it - this way, you can check to see if the block has been registered before (use the Page.IsClientScriptBlockRegistered(strScriptName) method to check on a script block).

Hope this helps. ________________________________________
Michael C Flanakin
Indigo Web Systems
michael.flanakin@indigows.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top