From: MCM14 on
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.

From: Harv on
On Jul 20, 1:58 pm, "MCM14" <mmo...(a)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.
From: Brian Cryer on
"MCM14" <mmoore(a)mcmconsulting.biz> wrote in message
news:23DD9568-D649-4FC7-84DA-4919CF97264C(a)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

From: MCM14 on
Why would a Timer be better? Does pausing the thread do something
particularly negative?


"Harv" wrote:

> On Jul 20, 1:58 pm, "MCM14" <mmo...(a)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.
> .
>
From: MCM14 on
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(a)mcmconsulting.biz> wrote in message
> news:23DD9568-D649-4FC7-84DA-4919CF97264C(a)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
>
> .
>