Get 'real' ClientId
Posted on 2005-04-21
The text box is nested several controls deep... here is a rough hierarchy....
Page > User Control > Data Grid > Data Grid Footer Item > TextBox
Right now I try to get the ClientId for the TextBox but it never matches what is output to the browser. For example, my output is "txtStockNbrToAdd". However, what it needs to be is something like "myCart_dgCartList__ctl2_txtStockNbrToAdd".
I know I can get the ClientId of the "myCart" User Control. I also know I can get the ClientId of the "dgCartList" DataGrid. What I can't predict is the "_ctl2" portion.
There must be some way to get the information I'm looking for....