I have a search page that takes a long time to load, about 1 min.
How can I prompt the user with a 'please wait' and a progress bar right
after the user submit the search words?
Thanks
AaronHi,
Perform the search during rendition process using threads.
protected override void Render(HtmlTextWriter writer)
{
System.Threading.Thread t = new System.Threading.Thread(SearchMethod);
t.Start();
writer.Write("Please wait...");
while(t.IsAlive)
{
writer.Write(".");
writer.Flush();
Page.Response.Flush();
System.Threading.Thread.Sleep(500);
}
}
m2
"Aaron" <kuya789@.yahoo.com> wrote in message
news:Oq2J2$SKFHA.436@.TK2MSFTNGP09.phx.gbl...
>I have a search page that takes a long time to load, about 1 min.
> How can I prompt the user with a 'please wait' and a progress bar right
> after the user submit the search words?
> Thanks
> Aaron
>
This is simplest solution I've seen:
http://www.aspnetpro.com/Newsletter...m_l.asp
I hope this helps,
Steve C. Orr, MCSD
http://SteveOrr.net
"Aaron" <kuya789@.yahoo.com> wrote in message
news:Oq2J2$SKFHA.436@.TK2MSFTNGP09.phx.gbl...
>I have a search page that takes a long time to load, about 1 min.
> How can I prompt the user with a 'please wait' and a progress bar right
> after the user submit the search words?
> Thanks
> Aaron
>
You may also try this one:
http://support.microsoft.com/defaul...kb;en-us;837375
Beware of this solution as it consumes a thread from the thread pool for
the entire minute. This will cause performance problems in your application
if you also have moderate load. You might want to look into some of the othe
r
solutions or take the idea of this approach below but make it an async page.
Fritz Onion describes this:
http://msdn.microsoft.com/msdnmag/i...ng/default.aspx
-Brock
DevelopMentor
http://staff.develop.com/ballen
> Hi,
> Perform the search during rendition process using threads.
> protected override void Render(HtmlTextWriter writer)
> {
> System.Threading.Thread t = new
> System.Threading.Thread(SearchMethod);
> t.Start();
> writer.Write("Please wait...");
> while(t.IsAlive)
> {
> writer.Write(".");
> writer.Flush();
> Page.Response.Flush();
> System.Threading.Thread.Sleep(500);
> }
> }
> --
> m2
> "Aaron" <kuya789@.yahoo.com> wrote in message
> news:Oq2J2$SKFHA.436@.TK2MSFTNGP09.phx.gbl...
>
Thanks for a link. Nice articel indeed.
"Brock Allen" <ballen@.develop.com.i_hate_spam_too> wrote in message
news:6920632464700463971776@.msnews.microsoft.com...
> Beware of this solution as it consumes a thread from the thread pool for
> the entire minute. This will cause performance problems in your
> application if you also have moderate load. You might want to look into
> some of the other solutions or take the idea of this approach below but
> make it an async page. Fritz Onion describes this:
> http://msdn.microsoft.com/msdnmag/i...ng/default.aspx
> -Brock
> DevelopMentor
> http://staff.develop.com/ballen
>
>
>
>
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment