Waiting untill the Web Form loads,while loading showing something else..

  • Thread starter Thread starter Nicholas Paldino [.NET/C# MVP]
  • Start date Start date
N

Nicholas Paldino [.NET/C# MVP]

Coskun,

What I would do is redirect the user to a different page which indicates
that a the processing is occuring. This page would refresh itself every few
seconds or so.

Once you have that, the page that refreshes would check a session
variable to see if the content is ready. If it is, then it redirects to the
page with the content.

Before you redirect to the original progress page, you would kick off
the processing in another thread, and then at the end of that thread, you
would set the variable in the session that is checked on the progress page
that refreshes itself.

Hope this helps.
 
In addition to nick's suggestion, you might also be able to use
Response.Write and Response.Flush to send out some HTML (a progress bar or
whatever) and have it on the same page.
-mike
MVP
 
Hi,

What I want to know is when a user clicks on a button I send him to another
page by using the Response.Redirect("") method. But the page that the user
is being sent to has to generate a picture so it takes time.. I want to show
a loading messeage there until the Newpage loads.. Anyone got any ideas ?

Thnks
Coskun
 
Hi ,

I would add another idea :)

I did this a while ago ( in ASP but the idea is the same ) basically your
page will consist of two div one with the "preload" html code and the other
with the real code itself, the latter will be nonvisible ( done with CSS )
then in the body's onload event you change the visibility of them.
now the tricky part is to push the static content to the browser ASAP this
can be done with a Response.Flush.

Now if you slow content is only an image you can do another thing, you can
set a static image instead of the dinamic image, then on the OnLoad handler
you can create a Image object and set the src to a page that generate the
real image. when the image is loaded you just assign this new image to the
static image and voila :)

Hope this help,
 
Back
Top