Delay Page Request Load

Discussion in 'ASP .Net' started by MCM14, Jul 20, 2010.

  1. MCM14

    MCM14 Guest

    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.
    MCM14, Jul 20, 2010
    #1
    1. Advertising

  2. MCM14

    Harv Guest

    On Jul 20, 1:58 pm, "MCM14" <> 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.
    Harv, Jul 20, 2010
    #2
    1. Advertising

  3. MCM14

    MCM14 Guest

    Why would a Timer be better? Does pausing the thread do something
    particularly negative?


    "Harv" wrote:

    > On Jul 20, 1:58 pm, "MCM14" <> 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, Jul 21, 2010
    #3
  4. MCM14

    MCM14 Guest

    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" <> wrote in message
    > news:...
    > >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
    >
    > .
    >
    MCM14, Jul 21, 2010
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Brian Birtle
    Replies:
    2
    Views:
    1,985
    John Saunders
    Oct 16, 2003
  2. Wayne  Wengert

    What Causes the Page Load Delay

    Wayne Wengert, Mar 31, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    469
    Wayne Wengert
    Mar 31, 2005
  3. venky

    Page Load and webcontrol page load

    venky, Jul 6, 2005, in forum: ASP .Net
    Replies:
    5
    Views:
    3,075
    venky
    Jul 11, 2005
  4. =?Utf-8?B?RENDLTcwMA==?=
    Replies:
    5
    Views:
    620
    =?Utf-8?B?RENDLTcwMA==?=
    Jan 9, 2006
  5. Matcon
    Replies:
    3
    Views:
    21,519
    Matcon
    May 28, 2008
Loading...

Share This Page