asp.net 2.0, control ids and clientID
- From: "Ily" <ilyas@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: 27 Oct 2006 04:07:56 -0700
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....
.
- Follow-Ups:
- Re: asp.net 2.0, control ids and clientID
- From: Axel Dahmen
- Re: asp.net 2.0, control ids and clientID
- Prev by Date: Web Site Manager: irritating data
- Next by Date: Re: asp.net 2.0, control ids and clientID
- Previous by thread: Web Site Manager: irritating data
- Next by thread: Re: asp.net 2.0, control ids and clientID
- Index(es):
Relevant Pages
|