C
CtrlAltDel
Here's a question for you - how do you reference the name of a radio
button group in JavaScript, when .NET insists on mangling the name?
If you have controls such as:
<asp:radiobutton id="button1" runat="server" groupname="mygroup" />
<asp:radiobutton id="button2" runat="server" groupname="mygroup" />
then the output ends up being something like this
<input id="ctl00_contentholder_parent_button1"
name="ctl00$contentholder$parent$mygroup" />
<input id="ctl00_contentholder_parent_button2"
name="ctl00$contentholder$parent$mygroup" />
(this example comes from .NET 2, hence the contentholder text)
Now the element can be referenced using Control.ClientID, and that
value written to your JavaScript. However, there isn't a readily
accessible equivalent for GroupName. VS2005 gives a tantalising peek
when debugging, by showing a private property UniqueGroupName, which
contains the desired value of ctl00$contentholder$parent$mygroup, but
as it's private, it's not readily accessible.
Any thoughts, other than *ug* hard coding the reference and praying
that no-one renames something?
button group in JavaScript, when .NET insists on mangling the name?
If you have controls such as:
<asp:radiobutton id="button1" runat="server" groupname="mygroup" />
<asp:radiobutton id="button2" runat="server" groupname="mygroup" />
then the output ends up being something like this
<input id="ctl00_contentholder_parent_button1"
name="ctl00$contentholder$parent$mygroup" />
<input id="ctl00_contentholder_parent_button2"
name="ctl00$contentholder$parent$mygroup" />
(this example comes from .NET 2, hence the contentholder text)
Now the element can be referenced using Control.ClientID, and that
value written to your JavaScript. However, there isn't a readily
accessible equivalent for GroupName. VS2005 gives a tantalising peek
when debugging, by showing a private property UniqueGroupName, which
contains the desired value of ctl00$contentholder$parent$mygroup, but
as it's private, it's not readily accessible.
Any thoughts, other than *ug* hard coding the reference and praying
that no-one renames something?