Monday, February 06, 2012 | |
Accessing controls using FindControl() in an UpdateProgress control
Location: BlogsRT-blog    
Posted by: Ron Smith 1/12/2010 9:27 AM

While trying to do some code-behind manipulation of a page I had trouble accessing the controls contained by an UpdateProgress control.  On the same page I have an UpdatePanel and I'm able to use FindControl() to locate controls contained by it in the CreateChildControls event (or any other event for that matter). Not so with the UpdateProgress control!  No matter what I tried the UpdateProgress control would not find any controls.

I finally stumbled upon a tip that you needed to do this in the page's PreRenderComplete event.  Like this:

void Page_PreRenderComplete( object sender, EventArgs e )
{
                Image ImageProgress = (Image)UpdateProgress1.FindControl( "ImageProgress" );
                if( ImageProgress != null  )
                {
                    //Do something with the image
                }
}

ASP.net 2.0, AJAX, UpdateProgress

Permalink |  Trackback

Your name:
Title:
Comment:
Security Code
Enter the code shown above in the box below
Add Comment   Cancel 
Search
Archive
Copyright 2009 Real Technology | Terms Of Use | Privacy Statement Home | RT-Blog | Contact Us | About RT