I'm having a hard time with INamingContainer.
I'm building a composite control that has a implements an HtmlGenericControl
Div control and an HtmlInputHidden control the Generic control works fine
but the HtmlInputHidden control is giving me all kinds of problems.
My code is something like this:
protected HtmlInputHidden HIH;
protected HtmlGenericControl HGC;
protectected overriden void CreateChildControls(){
Controls.Add(new LiteralControl("Bla Bla Not inportant static tags"));
HIH=new HtmlInputHidden();
HIH.Name=this.ClientID; // this produces the name something as follows
parentControl1:_ct14.
Control.Add(HIH);
<--Initialize the HtmlGenericControl bla bla left out for brevity-->
Now, my problem is this. I need to access HIH.name for a client-side
function (written in javascript) that access this control by its name as
apposed to the DOM document.getElementById(ID) something like
parentControl1_ct14.value. When I set the HIH.Name to the ClientID instead
of getting the expected parentControl1_ct14 I get parentControl:_ct14
(Notice the colon) This colon for some reason behaves like a delimiter in
javascript and returns an exception requiring a ")". I have also tried
using UniqueID but that too returns the same problem. Can someone tell me
what I am doing wrong here? this is driving me crazy and causing all kinds
of grief for me.
Thank you in advance,
Sam-