A
Axel Dahmen
Hi,
I've created a User Defined Control (.cs class) using JavaScript to address
another control. This only works when my UDC resides on the .aspx page
itself. If I add it to a Web User Control (.ascx), the target control's ID
attribute gets changed by ASP.NET and I can't address it anymore from my
generated JavaScript code.
Can someone please enlighten me on the following: How can I get the prefix
of the container my UDC is in? Is there a function available telling me if
the target ID belongs to a server control (Runat="server")?
Here's some more information:
My UDC basically provides a property allowing the web page author to enter
the ID of the targeted control, like:
<myNS:myCtrl Runat="server" ID="myControl" TargetID="MoveIt"/>
...
<aspanel Runat="server" ID="MoveIt"></aspanel>
In the source of my UDC I generate JavaScript to address the other control:
Page.RegisterClientScriptBlock("x"
, "<script>document.getElementById(" + TargetID + ")...</script>");
If TargetID points to a server control, I'd like to be able to add the
context prefix of my UDC's container to the generated JavaScript code.
TIA,
Axel Dahmen
I've created a User Defined Control (.cs class) using JavaScript to address
another control. This only works when my UDC resides on the .aspx page
itself. If I add it to a Web User Control (.ascx), the target control's ID
attribute gets changed by ASP.NET and I can't address it anymore from my
generated JavaScript code.
Can someone please enlighten me on the following: How can I get the prefix
of the container my UDC is in? Is there a function available telling me if
the target ID belongs to a server control (Runat="server")?
Here's some more information:
My UDC basically provides a property allowing the web page author to enter
the ID of the targeted control, like:
<myNS:myCtrl Runat="server" ID="myControl" TargetID="MoveIt"/>
...
<aspanel Runat="server" ID="MoveIt"></aspanel>
In the source of my UDC I generate JavaScript to address the other control:
Page.RegisterClientScriptBlock("x"
, "<script>document.getElementById(" + TargetID + ")...</script>");
If TargetID points to a server control, I'd like to be able to add the
context prefix of my UDC's container to the generated JavaScript code.
TIA,
Axel Dahmen