Causing a page refresh mid-method?

Discussion in 'ASP .Net' started by Kieran Benton, Jul 1, 2005.

  1. I've got a situation where I would like to make a label control visible
    whilst a few-seconds long process runs, something along the lines of
    "Please wait...". At the moment this all occurs inside the postback
    section of the page load event as:

    private void Page_Load(object sender, System.EventArgs e)
    {
    if(!this.IsPostBack)
    {
    <...>
    }
    else
    {
    <...>
    labLookingUp.Visible = true;
    string postcode = g.LatitudeLongitudeToPostcode(lat,lon); // The long
    running process!!
    labLookingUp.Visible = false;
    <...>
    }
    }

    But no page update occurs between the Visible = true and Visible =
    false, resulting in the control never becoming visible to the user. Is
    there any elegant way around this? Cheers.
    Kieran Benton, Jul 1, 2005
    #1
    1. Advertising

  2. Kieran Benton

    intrader Guest

    On Fri, 01 Jul 2005 10:15:27 -0700, Kieran Benton wrote:

    > I've got a situation where I would like to make a label control visible
    > whilst a few-seconds long process runs, something along the lines of
    > "Please wait...". At the moment this all occurs inside the postback
    > section of the page load event as:
    >
    > private void Page_Load(object sender, System.EventArgs e)
    > {
    > if(!this.IsPostBack)
    > {
    > <...>
    > }
    > else
    > {
    > <...>
    > labLookingUp.Visible = true;
    > string postcode = g.LatitudeLongitudeToPostcode(lat,lon); // The long
    > running process!!
    > labLookingUp.Visible = false;
    > <...>
    > }
    > }
    >
    > But no page update occurs between the Visible = true and Visible =
    > false, resulting in the control never becoming visible to the user. Is
    > there any elegant way around this? Cheers.

    Nothing too elegant, I am afraid. But you can render javascript that uses
    a timer to refresh the label with whatever you want.
    intrader, Jul 1, 2005
    #2
    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. MarkD
    Replies:
    0
    Views:
    742
    MarkD
    Dec 4, 2003
  2. MJB
    Replies:
    0
    Views:
    310
  3. Replies:
    1
    Views:
    349
    souri challa
    Jul 8, 2005
  4. Zach85

    Change stylesheet mid-page

    Zach85, Apr 13, 2009, in forum: HTML and CSS
    Replies:
    0
    Views:
    610
    Zach85
    Apr 13, 2009
  5. Pkenty
    Replies:
    0
    Views:
    388
    Pkenty
    May 28, 2004
Loading...

Share This Page