G
Grant Merwitz
Hi
I am trying to use JavaScript to change asp controls client side.
Now when creating a User Controls, controls that run at server are renamed
with the control tag name.
So if i make a control with an asp:TextBox with id 'tb'.
I then place this control into a webform with the tag UC1, the control is
then named 'UC1:tb'
Now to set this in JavaScript, i simply call tb.UniqueId - and this solves
this issue.
But now TextBoxes and Labels don't seem to work the same.
As in the above example, a textbox called 'tb' is renamed 'UC1:tb'
However a label called 'lbl' becomes 'UC1_lbl'.
Though the UniqueId produces 'UC1:lbl' - so i get a JavaScript error.
To overcome this i go lbl.UniqueId.Replace(":lbl", "_lbl");
Why is this happening?
Is there something I'm missing?
Thanks for any help
I am trying to use JavaScript to change asp controls client side.
Now when creating a User Controls, controls that run at server are renamed
with the control tag name.
So if i make a control with an asp:TextBox with id 'tb'.
I then place this control into a webform with the tag UC1, the control is
then named 'UC1:tb'
Now to set this in JavaScript, i simply call tb.UniqueId - and this solves
this issue.
But now TextBoxes and Labels don't seem to work the same.
As in the above example, a textbox called 'tb' is renamed 'UC1:tb'
However a label called 'lbl' becomes 'UC1_lbl'.
Though the UniqueId produces 'UC1:lbl' - so i get a JavaScript error.
To overcome this i go lbl.UniqueId.Replace(":lbl", "_lbl");
Why is this happening?
Is there something I'm missing?
Thanks for any help