RE: When does ClientID takeon the NamingContainer prefix - 01-24-2007 , 11:56 AM
If you use the ClientID before the control has been added , since strings are
immutable so a copy is made, any where you used the ClientID it will be old
and will not be updated. Unless you can provide code that says this, from
your description of it, this sounds like a by design issue.
This is why it is best to get everybody added to the hierarchy early on so
that there is no changing requied. And should any custom rendering or id
setting be done it be done as late as possible to ensure that anybody that
accidentally did get left behind got caught up.
Re: When does ClientID takeon the NamingContainer prefix - 01-25-2007 , 08:25 AM
You may try out a very simple thing...
Do the following in any method, say, Page_Load:
Label lbl = new Label();
lbl.ID = 'crazyLabel';
//Expect it to be crazyLabel
Debug.WriteLine("ClientID of Label before adding: " + lbl.ClientID);
Repeater r = new Repeater();
Debug.WriteLine("ClientID of Label after adding: " + lbl.ClientID);
Gaurav Vaish | www.mastergaurav.com
Re: When does ClientID takeon the NamingContainer prefix - 01-25-2007 , 08:55 AM
"Gaurav Vaish (MasterGaurav)" wrote:
I just don't like it!
Re: When does ClientID takeon the NamingContainer prefix - 01-31-2007 , 04:34 PM
This is probably similar stuff that I've blogged and reported at Connect
AspInsider, ASP.NET MVP
"Iain" <Iain (AT) discussions (DOT) microsoft.com> wrote
|Thread Tools||Search this Thread|