Using thread to partially load a page

G

Guest

I have an aspx page that can take a minute or so to load because it loads
images from a database. I want to open a window and show a "Please Wait"
message page at the start and close it when the page is ready to load with
Response.Write. I have opened a thread to do it but it doesn't work. Any
suggestions?

Here is the relevant part of my code:

=================================
public class Images : System.Web.UI.Page
{
public static void NewThread()
{
Images wb = new Images();
wb.WaitBox();
}


public void WaitBox()
{
string waitString="" ;
waitString="<script
language=\"javascript\">\n\twaitWindow=window.open(\"plswait.htm\",
\"WaitWindow\",
\"width=600,height=450,toolbar=no,status=no,menubar=no,resizable=no,scrollbars=no\");\n" +
"\twaitWindow.location=\"plswait.htm\";\n</script>";
Response.Write(waitString);
}

private void Page_Load(object sender, System.EventArgs e)
{
Thread thread = new Thread(new ThreadStart(NewThread));
thread.Start();

//
// Build htmlString here
//
//

thread.Abort();
Response.Write(htmlString);
}
}
=============================
Thanks,
Evan Hicks
 
H

Hasani

Have you considered caching the output or the data?
Evan said:
I have an aspx page that can take a minute or so to load because it loads
images from a database. I want to open a window and show a "Please Wait"
message page at the start and close it when the page is ready to load with
Response.Write. I have opened a thread to do it but it doesn't work. Any
suggestions?

Here is the relevant part of my code:

=================================
public class Images : System.Web.UI.Page
{
public static void NewThread()
{
Images wb = new Images();
wb.WaitBox();
}


public void WaitBox()
{
string waitString="" ;
waitString="<script
language=\"javascript\">\n\twaitWindow=window.open(\"plswait.htm\",
\"WaitWindow\",
\"width=600,height=450,toolbar=no,status=no,menubar=no,resizable=no,scrollba
rs=no\");\n" +
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top