Adding javascript to web custom controls (.htc?)

L

Lars H

I have made a web user controller. I would like to add some simple
javascript behaviour to it. How can i do this? Does it involve adding a .htc
file? I have found very little documentation on this subject, so i
appriciate all help.

/Lars
 
A

Axel Dahmen

Web User Controls are more or less macros expanding to some HTML code. If
you want to add some client-side JavaScript code to your controls, examine
the HTML created by ASP.NET and address the HTML elements according to the
DOM. If you've added some server-side Webcontrols to your UserControl, you
get its HTML element ID by using "myWebControl.UniqueID".

HTH,
Axel Dahmen
 
L

Lars H

I asked incorrectly about "web user controls" but I was actually talking
about "web custom controls". What i want to do is adding Javascript
behaviour to the web custom controller I have made. Similar to the
javascript behaviour in a .htc file connected to for example the
treeview-controller that is available for download many places on the net.
This treeview-controller has all its client-side behaviour defined in a .htc
file. But I cannot examine how it is done in the treeview-controller, as the
download only includes the .dll, not the source code. I do have examined the
..htc file, and it seems simple to make java script functions here. But how
do i connect the .htc file to the web custom controller?

/Lars
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top