Link to home
Start Free TrialLog in
Avatar of veruthandai
veruthandaiFlag for United States of America

asked on

JavaScript Reference with Master Pages

So, I'm still figuring out this JavaScript stuff.

Referencing another question, code posted below.

What if my imgCtrl is on a page that uses the MasterPage, and my JavaScript is on the MasterPage? Is there any way to reference it in that manner?
----------
<script type="text/javascript">
   var imgControlId = "<%= imgCtrl.ClientID %>";
</script>
 
in your javascript function
--------------------------
image = document.getElementById(imgControlId);
image.href = url;

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of CB_Thirumalai
CB_Thirumalai
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial