Last post Jun 06, 2011 04:30 PM by npstech
Jun 19, 2006 07:00 PM|bryanc|LINK
Jun 19, 2006 08:31 PM|bryanc|LINK
Jun 19, 2007 05:37 PM|ureyes84|LINK
Thanks for sharing !!!
Jul 17, 2007 08:44 AMemail@example.com|LINK
This was very helpful review. Thanks for sharing it with us.
Sep 14, 2007 06:42 AM|balpreet.patil|LINK
Thanks..dear it poped me out from a stuck.
its really helpful
Balpreet Patil (firstname.lastname@example.org)
Control Masterpage Contentpage
Oct 04, 2007 12:10 PM|koda|LINK
Good reply, it's probably a good idea to note that this is due to the late binding approach that you are using; however, you could also early bind this object/control as well:
pnlThumb1.Visible = false;
Dec 28, 2007 09:36 AM|fliz123|LINK
Thanks a lot dear friend.
Jun 25, 2008 03:19 PM|DaveRand|LINK
Oct 10, 2008 09:47 AM|iucon|LINK
You could create a more elegant solution by using a bit of reflection combined with extension classes:
public static class PageExtensions
public static T GetControl<T>(this Page page, string name) where T : Control
FieldInfo field = page.GetType().GetField(name, System.Reflection.BindingFlags.IgnoreCase | System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic);
if (field != null)
The call would then be
this.GetControl<Panel>("pnlThumb1").Visible = false;
Please find the complete sample with description on my blog
Jul 30, 2009 02:23 PM|ariusarius|LINK
thanks so much
Mar 12, 2010 02:32 PM|Mark Bennion|LINK
Thank you so much for this answer. It got my FindControl working !!!
Jul 01, 2010 09:37 AM|Stevishere|LINK
Another very succint, simple solution may be foud here:
Jun 06, 2011 04:30 PM|npstech|LINK
Wow. Thanks so much.
I'm dynamically creating controls in the Page Init event of a content page and was very surprised to find that I could not reference the controls I created. This will save me a LOT of time.