Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   Delay Page Request Load (http://www.velocityreviews.com/forums/t728776-delay-page-request-load.html)

MCM14 07-20-2010 07:58 PM

Delay Page Request Load
 
I need to simply delay the loading of a requested page by 5 seconds. I'm not
that that familiar with threading, so I just want to confirm that what I am
doing is correct please.

In the Load Sub for the page, I have the line:

System.Threading.Thread.Sleep(5000)

I want to make sure that this will only halt the loading of this particular
page - but that other requests to the application will not be stalled. Is
that correct? Or if not, how can I do so?

Thanks.


Harv 07-20-2010 08:20 PM

Re: Delay Page Request Load
 
On Jul 20, 1:58*pm, "MCM14" <mmo...@mcmconsulting.biz> wrote:
> I need to simply delay the loading of a requested page by 5 seconds. I'm not
> that that familiar with threading, so I just want to confirm that what I am
> doing is correct please.
>
> In the Load Sub for the page, I have the line:
>
> System.Threading.Thread.Sleep(5000)
>
> I want to make sure that this will only halt the loading of this particular
> page - but that other requests to the application will not be stalled. Is
> that correct? Or if not, how can I do so?
>
> Thanks.


I think a Timer might be a better solution for your pause.

MCM14 07-21-2010 09:06 PM

Re: Delay Page Request Load
 
Why would a Timer be better? Does pausing the thread do something
particularly negative?


"Harv" wrote:

> On Jul 20, 1:58 pm, "MCM14" <mmo...@mcmconsulting.biz> wrote:
> > I need to simply delay the loading of a requested page by 5 seconds. I'm not
> > that that familiar with threading, so I just want to confirm that what I am
> > doing is correct please.
> >
> > In the Load Sub for the page, I have the line:
> >
> > System.Threading.Thread.Sleep(5000)
> >
> > I want to make sure that this will only halt the loading of this particular
> > page - but that other requests to the application will not be stalled. Is
> > that correct? Or if not, how can I do so?
> >
> > Thanks.

>
> I think a Timer might be a better solution for your pause.
> .
>


MCM14 07-21-2010 09:35 PM

Re: Delay Page Request Load
 
I actually do want the loading of this particular page to be slow. It is a
"print view" popup, and because of some weird AJAX & popup blocker & Session
State issues, I need this page to pause loading for a few seconds to ensure
that the data gets successfully uploaded by the AJAX function.

Anyway, none of that matters for this discussion. My goal is simply to pause
the loading of this one page request without pausing any of the other
processing in the application for other page requests and processes.


"Brian Cryer" wrote:

> "MCM14" <mmoore@mcmconsulting.biz> wrote in message
> news:23DD9568-D649-4FC7-84DA-4919CF97264C@microsoft.com...
> >I need to simply delay the loading of a requested page by 5 seconds. I'm
> >not that that familiar with threading, so I just want to confirm that what
> >I am doing is correct please.
> >
> > In the Load Sub for the page, I have the line:
> >
> > System.Threading.Thread.Sleep(5000)
> >
> > I want to make sure that this will only halt the loading of this
> > particular page - but that other requests to the application will not be
> > stalled. Is that correct? Or if not, how can I do so?

>
> What are you after when you say you want to delay loading of the page? If
> you put a sleep in the page_load then when someone navigates to the page
> then will have to wait an extra 5 seconds for the page to load, which will
> mean that the page will seem VERY slow. Is that what you want? (I can see
> reasons during development why you might perhaps want this but not on a
> customer facing site.)
>
> Or do you want a timer (as suggestd by Harv) on a different page which will
> delay forwarding to this page?
> --
> Brian Cryer
> http://www.cryer.co.uk/brian
>
> .
>



All times are GMT. The time now is 07:32 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.