Click here to Skip to main content
15,919,245 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

Is there anyway to call a js function defined in another controll?

for example if function "sayHello" defined in a.ascx. how can i call it in b.ascx?

Thank you.
Posted
Updated 15-Oct-10 17:54pm
v2

1 solution

As far as you know the function name you can call the javascript function defined in another control. Because every user control's html and javascript are included in the final page rendered.

Also, in case you want to access html element's in 1 user control in another user control you could also assign a css class to that server control defined in the user control and access it in the other user control using jQuery.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900