AddOnPreRenderCompleteAsync and no page content

  • Thread starter Thread starter phil
  • Start date Start date
P

phil

I decided to use AddOnPreRenderCompleteAsync to avoid holding on to a
thread pool thread for too long. (I do some webserver I/O etc. during
the page build).

In the beginevent handler I fire up a new thread (not a thread pool
thread, but rather System.Threading.Thread) and within that thread I
do all of my page build. Eventually my endevent handler gets called
and the page completes.

It works perfectly except for one major problem: most of my page
content is missing. For example, I have a panel called 'viewpanel'
that I add a bunch of dynamically created tables to. The viewpanel
shows in the markup, but non of its tables. Within the Control Tree
(as shown using the ASP.NET trace feature), the various tables are
there shown under viewpanel's hierarchy though the render size bytes
are 0.

What am I missing?
 
I decided to use AddOnPreRenderCompleteAsync to avoid holding on to a
thread pool thread for too long. (I do some webserver I/O etc. during
the page build).

In the beginevent handler I fire up a new thread (not a thread pool
thread, but rather System.Threading.Thread) and within that thread I
do all of my page build. Eventually my endevent handler gets called
and the page completes.

It works perfectly except for one major problem: most of my page
content is missing. For example, I have a panel called 'viewpanel'
that I add a bunch of dynamically created tables to. The viewpanel
shows in the markup, but non of its tables. Within the Control Tree
(as shown using the ASP.NET trace feature), the various tables are
there shown under viewpanel's hierarchy though the render size bytes
are 0.

What am I missing?


I think i will respond to my own post! I figured out the problem... I
set viewpanel.Visible = false and later viewpanel.Visible = true...
for some reason, setting it to false first causes this behavior. This
must be some kind of bug in ASP.NET. Remember I am filling the
viewpanel at a different point in the ASP.NET page cycle so it must
have something to do with that...
 
Back
Top