I'm using asp.net 2.0 and the Ajax Web Extensions.
I create a control with a label (lblStudentID) and when the page renders, it becomes XXXXX_XXXXX_ControlInstanceName_PanelInstanceName_OriginalControlID
If I use Javascripts
or Microsoft Ajax's
they wont find a reference to the control. If it were an HTML control, this wouldn't be a problem as ASP.Net 2.0 doesn't rename their ID's.
The problem I'm seeing is that in my control, I only have control over the PanelInstanceName & OriginalControlID. I have no idea which control(s) (if any) that my usercontrol will be used in.
Is there a programatical way to determine what that name would be? We were hoping that MSAjax would take the ServerSideID and find the ClientSideID, but no dice. On all examples I've seen (AppDev videos, Ajax.ASP.Net or documentation) they use either an html control or hardcode the generated name.
I'm looking for something via Javascript or MSAjax Javascript that would get me the "XXXXX_XXXXX_ControlInstanceName" portion that I don't know about and would allow me to append the portion of the name I will know.
Something like
that would allow me to create the dynamic client name.
Anyone have any tips or advice? I've been googling for days and maybe I'm not using the correct terms, but I'm not finding anything. I'd greatly appreciate any help on this subject
I create a control with a label (lblStudentID) and when the page renders, it becomes XXXXX_XXXXX_ControlInstanceName_PanelInstanceName_OriginalControlID
If I use Javascripts
Code:
document.forms[0].getElementById(OriginalControlID)
Code:
$get(OriginalControlID)
The problem I'm seeing is that in my control, I only have control over the PanelInstanceName & OriginalControlID. I have no idea which control(s) (if any) that my usercontrol will be used in.
Is there a programatical way to determine what that name would be? We were hoping that MSAjax would take the ServerSideID and find the ClientSideID, but no dice. On all examples I've seen (AppDev videos, Ajax.ASP.Net or documentation) they use either an html control or hardcode the generated name.
I'm looking for something via Javascript or MSAjax Javascript that would get me the "XXXXX_XXXXX_ControlInstanceName" portion that I don't know about and would allow me to append the portion of the name I will know.
Something like
Code:
$get(ControlParent + "_PanelInstanceName_OriginalControlID"
Anyone have any tips or advice? I've been googling for days and maybe I'm not using the correct terms, but I'm not finding anything. I'd greatly appreciate any help on this subject