Tell user page is "working" - not changing the page

Discussion in 'ASP .Net' started by =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?=, Mar 9, 2006.

  1. Hi;

    ..NET 2.0

    I have a situation where when the user selects an item in a drop down list,
    the code behind is called to update the values in another list on the page.
    This update can take 3 - 5 seconds.

    When it is complete, the same page is still displayed. What is the best way
    to tell the user the page is working? I don't like the idea of switching to a
    page that says "thinking..." and then going back to the page on.

    --
    thanks - dave
    david_at_windward_dot_net
    http://www.windwardreports.com
    =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?=, Mar 9, 2006
    #1
    1. Advertising

  2. Search for atlas

    Good Luck
    DWS

    "David Thielen" wrote:

    > Hi;
    >
    > .NET 2.0
    >
    > I have a situation where when the user selects an item in a drop down list,
    > the code behind is called to update the values in another list on the page.
    > This update can take 3 - 5 seconds.
    >
    > When it is complete, the same page is still displayed. What is the best way
    > to tell the user the page is working? I don't like the idea of switching to a
    > page that says "thinking..." and then going back to the page on.
    >
    > --
    > thanks - dave
    > david_at_windward_dot_net
    > http://www.windwardreports.com
    >
    =?Utf-8?B?RFdT?=, Mar 9, 2006
    #2
    1. Advertising

  3. Hi Dave,

    For your scenario, you want to display some message on page to inform the
    user the page is executing some task and do not leave the current page, I
    think one common approach is use client-side script code to display an
    image or Text (label or html <div> ) in the center of the page. Actually
    we can put that image or Label in the page in advance and make it
    invisible(set the html "display" style to "none". For example:

    <img id="imgRing" src="Images/ReportServer.gif" style="display:none"
    width="200" height="200" />

    Then, in our button's client-side onclick event or the html <form>'s
    "onsubmit", we can use script to make the image or label visible:

    <script language="javascript">
    function ShowImage()
    {
    document.getElementById("imgRing").src = "Images/Ring.gif";
    document.getElementById("imgRing").style.display = "";

    }
    </script>


    <form id="form1" runat="server" onsubmit="ShowImage();">


    Hope this helps.

    Regards,

    Steven Cheng
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)
    Steven Cheng[MSFT], Mar 10, 2006
    #3
  4. Dave Sussman and Alex Homer wrote this pretty "staged load" page display:

    http://www.daveandal.net/books/6744/loadpost/stagedloading.aspx

    It displays progress without switching the page.

    There's a link to the code at that page.
    Although it was written as an ASP.NET 1.1 sample, it will work in 2.0.



    Juan T. Llibre, asp.net MVP
    aspnetfaq.com : http://www.aspnetfaq.com/
    asp.net faq : http://asp.net.do/faq/
    foros de asp.net, en español : http://asp.net.do/foros/
    ===================================
    "David Thielen" <> wrote in message
    news:...
    > Hi;
    >
    > .NET 2.0
    >
    > I have a situation where when the user selects an item in a drop down list,
    > the code behind is called to update the values in another list on the page.
    > This update can take 3 - 5 seconds.
    >
    > When it is complete, the same page is still displayed. What is the best way
    > to tell the user the page is working? I don't like the idea of switching to a
    > page that says "thinking..." and then going back to the page on.
    >
    > --
    > thanks - dave
    > david_at_windward_dot_net
    > http://www.windwardreports.com
    >
    Juan T. Llibre, Mar 10, 2006
    #4
  5. great idea - thanks

    --
    thanks - dave
    david_at_windward_dot_net
    http://www.windwardreports.com



    "Steven Cheng[MSFT]" wrote:

    > Hi Dave,
    >
    > For your scenario, you want to display some message on page to inform the
    > user the page is executing some task and do not leave the current page, I
    > think one common approach is use client-side script code to display an
    > image or Text (label or html <div> ) in the center of the page. Actually
    > we can put that image or Label in the page in advance and make it
    > invisible(set the html "display" style to "none". For example:
    >
    > <img id="imgRing" src="Images/ReportServer.gif" style="display:none"
    > width="200" height="200" />
    >
    > Then, in our button's client-side onclick event or the html <form>'s
    > "onsubmit", we can use script to make the image or label visible:
    >
    > <script language="javascript">
    > function ShowImage()
    > {
    > document.getElementById("imgRing").src = "Images/Ring.gif";
    > document.getElementById("imgRing").style.display = "";
    >
    > }
    > </script>
    >
    >
    > <form id="form1" runat="server" onsubmit="ShowImage();">
    >
    >
    > Hope this helps.
    >
    > Regards,
    >
    > Steven Cheng
    > Microsoft Online Support
    >
    > Get Secure! www.microsoft.com/security
    > (This posting is provided "AS IS", with no warranties, and confers no
    > rights.)
    >
    >
    =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?=, Mar 10, 2006
    #5
  6. =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?=

    Mike Ogden Guest

    I've needed to do a similar thing, but took a slightly different
    approach. On the submit button, it calls a javascript function which
    opens a "Please Wait" modeless dialog. In the URL of the Please Wait
    window I pass the postback ID and EventArg of the button (which would be
    used for the __doPostBack()) in the querystring and I pass the Window
    object into the window.showModelessDialog() method similar to the
    example here:
    http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml
    /reference/methods/showmodelessdialog.asp

    Then I have a ContinuePostBack() method in the main page where the
    submit button exists which takes the EventID and EventArg and simply
    calls the __doPostBack() event. When the Please Wait window opens, it
    calls the ContinuePostBack function on the main window and passes in the
    EventID and EventArg from its URL. The ContinuePostBack will start the
    PostBack process which after it completes the page refreshes which
    clears the Please Wait modeless dialog, so you don't have to worry about
    trying to close that window. I originally tried to just open the Please
    Wait window then continue with the __doPostBack, but I think there was a
    timing issue because the Please Wait would not always display. So I
    resolved that by having the Please Wait window be the thing that called
    the ContinuePostBack function... that gaurantees the window will open
    before the postback starts.

    I'm thinking about taking this another step by having the long process
    write status messages to a session variable and having the Please Wait
    window auto-refresh and read that session variable every 5 seconds or
    so.

    *** Sent via Developersdex http://www.developersdex.com ***
    Mike Ogden, Mar 11, 2006
    #6
  7. Hi;

    More than I need this time but keeping this for future use.

    --
    thanks - dave
    david_at_windward_dot_net
    http://www.windwardreports.com



    "Mike Ogden" wrote:

    > I've needed to do a similar thing, but took a slightly different
    > approach. On the submit button, it calls a javascript function which
    > opens a "Please Wait" modeless dialog. In the URL of the Please Wait
    > window I pass the postback ID and EventArg of the button (which would be
    > used for the __doPostBack()) in the querystring and I pass the Window
    > object into the window.showModelessDialog() method similar to the
    > example here:
    > http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml
    > /reference/methods/showmodelessdialog.asp
    >
    > Then I have a ContinuePostBack() method in the main page where the
    > submit button exists which takes the EventID and EventArg and simply
    > calls the __doPostBack() event. When the Please Wait window opens, it
    > calls the ContinuePostBack function on the main window and passes in the
    > EventID and EventArg from its URL. The ContinuePostBack will start the
    > PostBack process which after it completes the page refreshes which
    > clears the Please Wait modeless dialog, so you don't have to worry about
    > trying to close that window. I originally tried to just open the Please
    > Wait window then continue with the __doPostBack, but I think there was a
    > timing issue because the Please Wait would not always display. So I
    > resolved that by having the Please Wait window be the thing that called
    > the ContinuePostBack function... that gaurantees the window will open
    > before the postback starts.
    >
    > I'm thinking about taking this another step by having the long process
    > write status messages to a session variable and having the Please Wait
    > window auto-refresh and read that session variable every 5 seconds or
    > so.
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    >
    =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?=, Mar 11, 2006
    #7
  8. that is way cool. More than I need right now but very very cool. Buying the
    book!

    --
    thanks - dave
    david_at_windward_dot_net
    http://www.windwardreports.com



    "Juan T. Llibre" wrote:

    > Dave Sussman and Alex Homer wrote this pretty "staged load" page display:
    >
    > http://www.daveandal.net/books/6744/loadpost/stagedloading.aspx
    >
    > It displays progress without switching the page.
    >
    > There's a link to the code at that page.
    > Although it was written as an ASP.NET 1.1 sample, it will work in 2.0.
    >
    >
    >
    > Juan T. Llibre, asp.net MVP
    > aspnetfaq.com : http://www.aspnetfaq.com/
    > asp.net faq : http://asp.net.do/faq/
    > foros de asp.net, en español : http://asp.net.do/foros/
    > ===================================
    > "David Thielen" <> wrote in message
    > news:...
    > > Hi;
    > >
    > > .NET 2.0
    > >
    > > I have a situation where when the user selects an item in a drop down list,
    > > the code behind is called to update the values in another list on the page.
    > > This update can take 3 - 5 seconds.
    > >
    > > When it is complete, the same page is still displayed. What is the best way
    > > to tell the user the page is working? I don't like the idea of switching to a
    > > page that says "thinking..." and then going back to the page on.
    > >
    > > --
    > > thanks - dave
    > > david_at_windward_dot_net
    > > http://www.windwardreports.com
    > >

    >
    >
    >
    =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?=, Mar 11, 2006
    #8
  9. re:
    > that is way cool.


    Don't forget to play with all the free code they have available :

    http://www.daveandal.net/download.asp?file=6744-code.zip

    You can run all their examples online at :
    http://www.daveandal.net/books/6744/samples.aspx

    re:
    Buying the book!

    Get it new for 31.49 at :
    http://www.amazon.com/exec/obidos/ASIN/0672326744/davedandalboo-20/102-8736665-0133725

    or new, starting at about $24 at :
    http://www.amazon.com/gp/offer-listing/0672326744/ref=dp_pb_a//102-8736665-0133725?condition=all:

    or used starting at $22. at the same page.



    Juan T. Llibre, asp.net MVP
    aspnetfaq.com : http://www.aspnetfaq.com/
    asp.net faq : http://asp.net.do/faq/
    foros de asp.net, en español : http://asp.net.do/foros/
    ===================================
    "David Thielen" <> wrote in message
    news:D...
    > that is way cool. More than I need right now but very very cool. Buying the
    > book!
    >
    > --
    > thanks - dave
    > david_at_windward_dot_net
    > http://www.windwardreports.com
    >
    >
    >
    > "Juan T. Llibre" wrote:
    >
    >> Dave Sussman and Alex Homer wrote this pretty "staged load" page display:
    >>
    >> http://www.daveandal.net/books/6744/loadpost/stagedloading.aspx
    >>
    >> It displays progress without switching the page.
    >>
    >> There's a link to the code at that page.
    >> Although it was written as an ASP.NET 1.1 sample, it will work in 2.0.
    >>
    >>
    >>
    >> Juan T. Llibre, asp.net MVP
    >> aspnetfaq.com : http://www.aspnetfaq.com/
    >> asp.net faq : http://asp.net.do/faq/
    >> foros de asp.net, en español : http://asp.net.do/foros/
    >> ===================================
    >> "David Thielen" <> wrote in message
    >> news:...
    >> > Hi;
    >> >
    >> > .NET 2.0
    >> >
    >> > I have a situation where when the user selects an item in a drop down list,
    >> > the code behind is called to update the values in another list on the page.
    >> > This update can take 3 - 5 seconds.
    >> >
    >> > When it is complete, the same page is still displayed. What is the best way
    >> > to tell the user the page is working? I don't like the idea of switching to a
    >> > page that says "thinking..." and then going back to the page on.
    >> >
    >> > --
    >> > thanks - dave
    >> > david_at_windward_dot_net
    >> > http://www.windwardreports.com
    >> >

    >>
    >>
    >>
    Juan T. Llibre, Mar 11, 2006
    #9
    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. Visual Systems AB \(Martin Arvidsson\)

    Q: Please tell me why this is not working.

    Visual Systems AB \(Martin Arvidsson\), Oct 5, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    443
    Karl Seguin
    Oct 5, 2004
  2. =?Utf-8?B?Sm9l?=
    Replies:
    2
    Views:
    497
    David Jessee
    Jan 20, 2005
  3. yogesh
    Replies:
    1
    Views:
    359
    Victor Bazarov
    Mar 14, 2007
  4. Raj
    Replies:
    0
    Views:
    145
  5. Mike A
    Replies:
    17
    Views:
    254
    Dr John Stockton
    Nov 19, 2003
Loading...

Share This Page