View Single Post
  #4 (permalink)  
Old July 31st, 2008, 06:00 AM
robzyc robzyc is offline
Friend of Wrox
Join Date: Mar 2007
Location: Hampshire, United Kingdom.
Posts: 432
Thanks: 0
Thanked 1 Time in 1 Post

Hi Richard,

Yeah I think the problem here is that the control is nested within a template. I think (and feel free to correct me anyone!) to overcome any issues with naming collisions, container controls are responsible for ensuring their child controls are uniquely named (normally done by prefixing the ID's with their own).

I had similar problems when creating a custom control of mine. You can see if this is taking place by commenting out your greeting code (to get it to run) and then view the page source to check the ID of the label control.

To get around this? I ended up exposing the child controls collection, now I am assuming some sort of similar mechanism is in place for templated controls?

Try examining the controls hierarchy, you may find the path to your control there (e.g. UpLoginView.Controls["ctlGreeting"] or something of the like).

Sorry I cant be more descriptive as I have not had a chance to delve too deeply into this myself, as its all kind of new to me also! :)

I hope this at least helps a little :D