I
Ily
Hi
I have a simple master page and a simpel webform that uses this master
page
Inside the webform is a textbox, the id of the textbox is txt1.
Now on the client, I want to do some scripting using this textbox and
that means I need the id.
But the client id is something like ct00_ContentPlaceHolder1_txt1
Hmmm - not very friendly for a start not to mention its a bit long! Who
is the world would call a control that! (okay I called mine txt1 - but
at least thats obvious!)
My issue is -
1)This prefix will change according to the namingcontainer, has anybody
found an elegant way of working with the control on the client,
regardless of where the control resides. I mean I would like to say on
my client
var objTxt1=document.getElementById('txt1');
but I cant!
Whats the reccomended route to take here....
I have a simple master page and a simpel webform that uses this master
page
Inside the webform is a textbox, the id of the textbox is txt1.
Now on the client, I want to do some scripting using this textbox and
that means I need the id.
But the client id is something like ct00_ContentPlaceHolder1_txt1
Hmmm - not very friendly for a start not to mention its a bit long! Who
is the world would call a control that! (okay I called mine txt1 - but
at least thats obvious!)
My issue is -
1)This prefix will change according to the namingcontainer, has anybody
found an elegant way of working with the control on the client,
regardless of where the control resides. I mean I would like to say on
my client
var objTxt1=document.getElementById('txt1');
but I cant!
Whats the reccomended route to take here....