S
senfo
I'm having an issue with trying to access the client-side ID of a
control in a WebControl that I'm designing.
Basically, I'm attempting to add a JavaScript onclick event handler to
an image and pass the ID of another control to the the function that the
event handler call.
Example:
MyTable.ID = "SomethingUnique";
MyImage.Attributes.Add("onclick", "foo('" + MyTable.ClientID + "');");
Unfortunately, the rendered HTML for this code resembles the following:
<img src="img.png" alt="Test Image" title="Test Image"
onclick="foo('SomethingUnique');" />
<table id="ctl00_PageContent_PlaceHolder_MyControl_SomethingUnique">
[...]
</table>
Unfortunately, as there are X number of tables generated, I will not
know the ID's until runtime.
I've tried to access the *real* ID of the client-side control through
the ID, UniqueID and ClientID properties of the Image control --each to
no avail.
Any ideas?
Thank you in advance,
control in a WebControl that I'm designing.
Basically, I'm attempting to add a JavaScript onclick event handler to
an image and pass the ID of another control to the the function that the
event handler call.
Example:
MyTable.ID = "SomethingUnique";
MyImage.Attributes.Add("onclick", "foo('" + MyTable.ClientID + "');");
Unfortunately, the rendered HTML for this code resembles the following:
<img src="img.png" alt="Test Image" title="Test Image"
onclick="foo('SomethingUnique');" />
<table id="ctl00_PageContent_PlaceHolder_MyControl_SomethingUnique">
[...]
</table>
Unfortunately, as there are X number of tables generated, I will not
know the ID's until runtime.
I've tried to access the *real* ID of the client-side control through
the ID, UniqueID and ClientID properties of the Image control --each to
no avail.
Any ideas?
Thank you in advance,