Link to home
Start Free TrialLog in
Avatar of jblanchardwork
jblanchardwork

asked on

javascript and gridview and divs and Id's. How do I find the id's????

Okay,

This should be fairly easy for somebody but its driving me crazy. I have a gridview with a number of rows. Each row has a simple hyperlink/javascript that turns on/off  a div in the same row. Something like this:

<a href="#" onclick="switchMenu('divName');">and some text</a>
<div id="divName">

All I wish to do is be able to identify the div id so that I can reset its style properties. Everything I try fails because of the way .net renames everything to insure uniqueness. I did manage to get divName.ClientID.ToString() via the ItemBound event for the gridview. But this fails as well when trying to execute the javascript??

Any help out there????
Avatar of QPR
QPR
Flag of New Zealand image

How are you creating the div in the first place? via a templatecolumn in the gridview?
ASKER CERTIFIED SOLUTION
Avatar of Munawar Hussain
Munawar Hussain
Flag of Pakistan 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