Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Causing a page refresh mid-method?

Reply
Thread Tools

Causing a page refresh mid-method?

 
 
Kieran Benton
Guest
Posts: n/a
 
      07-01-2005
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.

 
Reply With Quote
 
 
 
 
intrader
Guest
Posts: n/a
 
      07-01-2005
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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Page.SmartNavigation = True (Button click and Page refresh issue) Lenny Shprekher ASP .Net 0 02-23-2005 06:39 PM
JSP: Session parameters vanish on refresh. How do I keep them on refresh? Per Magnus L?vold Java 1 10-08-2004 02:52 PM
How do i refresh a datagrid from a pop up window without having to refresh the whole page? Pkenty ASP .Net Web Controls 0 05-28-2004 07:06 AM
using refresh button on the menu bar to refresh two frames. Jawahar Rajan ASP General 1 10-01-2003 09:20 PM
Problem with refresh button breaking automatic refresh brian lanning ASP .Net 0 07-29-2003 07:57 PM



Advertisments