473,769 Members | 4,584 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Reload Page Command

1. I have a chain of six asynch callbacks initiated by a button, and want
the page to refresh at the end of each callback to display

A. Results of a SQLServer query showing cumulative running time, and
B. A progress bar.

2. I have this working with a refresh timer:

<META http-equiv="refresh" content="5">

3. However, the blinking of page reloads is annoying, and I'd prefer to have
the page reload at exactly the end of each callback EndInvoke.

What is the command to force page reload in C#?

4. One of my HandleCompletio ns is below, with the place indicated where I
want to reload the page.

Thanks for any help.

Alan

private void HandleUpdateCap italCompletion( IAsyncResult asyncResult)

{

try

{

// Retrieve Update delegate object

UpdateCapitalDe legate updateCapital = (UpdateCapitalD elegate)
asyncResult.Asy ncState;

//Call EndInvoke to get result of UpdateCapital

string updateCapitalRe sult = updateCapital.E ndInvoke(asyncR esult);

//*** RELOAD THE PAGE HERE ****

// Start next delegate in chain

StartUpdateAver ageCapitalDeleg ate();

}

catch (Exception ex)

{

// Exception will be thrown by EndInvoke if Update() threw an exception

Console.Error.W riteLine(ex.ToS tring());

}

}
Nov 18 '05 #1
18 10145
Certainly the command you look for :

Server.Transfer (Request.Server Variables["SCRIPT_NAM E"]);

"Alan Z. Scharf" <as*****@grapev ines.com> a écrit dans le message de
news:ea******** ******@TK2MSFTN GP11.phx.gbl...
1. I have a chain of six asynch callbacks initiated by a button, and want
the page to refresh at the end of each callback to display

A. Results of a SQLServer query showing cumulative running time, and
B. A progress bar.

2. I have this working with a refresh timer:

<META http-equiv="refresh" content="5">

3. However, the blinking of page reloads is annoying, and I'd prefer to have the page reload at exactly the end of each callback EndInvoke.

What is the command to force page reload in C#?

4. One of my HandleCompletio ns is below, with the place indicated where I
want to reload the page.

Thanks for any help.

Alan

private void HandleUpdateCap italCompletion( IAsyncResult asyncResult)

{

try

{

// Retrieve Update delegate object

UpdateCapitalDe legate updateCapital = (UpdateCapitalD elegate)
asyncResult.Asy ncState;

//Call EndInvoke to get result of UpdateCapital

string updateCapitalRe sult = updateCapital.E ndInvoke(asyncR esult);

//*** RELOAD THE PAGE HERE ****

// Start next delegate in chain

StartUpdateAver ageCapitalDeleg ate();

}

catch (Exception ex)

{

// Exception will be thrown by EndInvoke if Update() threw an exception

Console.Error.W riteLine(ex.ToS tring());

}

}

Nov 18 '05 #2
Hi Alan,

From your description, you have a long-time operation at the asp.net page's
serverside code so used a asynthronous call to do the operation and
currently you use the <META http-equiv="refresh" content="5">
tag to refresh the waiting page so that it'll post back to check the async
call's state, but you found it'll make the page
blink so you're wondering how to make the page posted back when he async
call finshed via serverside code, yes?

As for this problem, here are my suggestions:
The <META http-equiv="refresh" content="5">
is used to refresh the page(let it post pack to the serverside), we can
also do this via javascript, such as form.submit();
All this is done at client, because when a page is sent back to client,
there is no relation with serverside, this is also the feature of the
HTTP(stateless ) based application. So we can't make a page at client to
post back via calling a method at serverside.

However, as for the page blinking you mentioned, based on my experience,
most one often use a hidden frame or iframe page to workaround this. We can
make a waiting page, which contain a embeded frame or iframe and the frame
contains the acutal refreshing page, and set the frame's width and height =
1 so as to make it hidden. Then, the hidden page is constantly refreshed,
the main waiting page won't be blinking. How do you think of this?

If you have anything unclear, please feel free to post here. Thanks.

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.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Nov 18 '05 #3
Steven,

Thanks for your reply.

1. Regarding the use of a hidden frame, would I still be able to display
progress somewhere without blinking?

Right now, every time my main page refreshes, it queries a table in
SQLServer which is being updated with cumulative running time at the end of
each stored procedure in the chain of asynch calls. This table of
cumulative time and other indicators is then displayed in a datagrid on
repost.

2. If not, then can you offer more detail on javascript for resubmitting.

So far, I fould reference to a java command: document.forms[0].submit, but
am not sure how to integrate it into my .aspx page.

Regards,

Alan
"Steven Cheng[MSFT]" <v-******@online.m icrosoft.com> wrote in message
news:yk******** *****@cpmsftngx a10.phx.gbl...
Hi Alan,

From your description, you have a long-time operation at the asp.net page's serverside code so used a asynthronous call to do the operation and
currently you use the <META http-equiv="refresh" content="5">
tag to refresh the waiting page so that it'll post back to check the async
call's state, but you found it'll make the page
blink so you're wondering how to make the page posted back when he async
call finshed via serverside code, yes?

As for this problem, here are my suggestions:
The <META http-equiv="refresh" content="5">
is used to refresh the page(let it post pack to the serverside), we can
also do this via javascript, such as form.submit();
All this is done at client, because when a page is sent back to client,
there is no relation with serverside, this is also the feature of the
HTTP(stateless ) based application. So we can't make a page at client to
post back via calling a method at serverside.

However, as for the page blinking you mentioned, based on my experience,
most one often use a hidden frame or iframe page to workaround this. We can make a waiting page, which contain a embeded frame or iframe and the frame
contains the acutal refreshing page, and set the frame's width and height = 1 so as to make it hidden. Then, the hidden page is constantly refreshed,
the main waiting page won't be blinking. How do you think of this?

If you have anything unclear, please feel free to post here. Thanks.

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.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Nov 18 '05 #4
Saperlipopette,

I'm still trying to het this to work with my async callbacks.

Regards,

Alan
"Saperlipopette " <saperlipopette @null> wrote in message
news:40******** **************@ news.free.fr...
Certainly the command you look for :

Server.Transfer (Request.Server Variables["SCRIPT_NAM E"]);

"Alan Z. Scharf" <as*****@grapev ines.com> a écrit dans le message de
news:ea******** ******@TK2MSFTN GP11.phx.gbl...
1. I have a chain of six asynch callbacks initiated by a button, and want the page to refresh at the end of each callback to display

A. Results of a SQLServer query showing cumulative running time, and
B. A progress bar.

2. I have this working with a refresh timer:

<META http-equiv="refresh" content="5">

3. However, the blinking of page reloads is annoying, and I'd prefer to

have
the page reload at exactly the end of each callback EndInvoke.

What is the command to force page reload in C#?

4. One of my HandleCompletio ns is below, with the place indicated where I want to reload the page.

Thanks for any help.

Alan

private void HandleUpdateCap italCompletion( IAsyncResult asyncResult)

{

try

{

// Retrieve Update delegate object

UpdateCapitalDe legate updateCapital = (UpdateCapitalD elegate)
asyncResult.Asy ncState;

//Call EndInvoke to get result of UpdateCapital

string updateCapitalRe sult = updateCapital.E ndInvoke(asyncR esult);

//*** RELOAD THE PAGE HERE ****

// Start next delegate in chain

StartUpdateAver ageCapitalDeleg ate();

}

catch (Exception ex)

{

// Exception will be thrown by EndInvoke if Update() threw an exception

Console.Error.W riteLine(ex.ToS tring());

}

}


Nov 18 '05 #5
Steven,

Thanks very much for your reply and the examples. I will try to work
through them tomorrow.

Regards,

Alan
"Steven Cheng[MSFT]" <v-******@online.m icrosoft.com> wrote in message
news:Wo******** ******@cpmsftng xa10.phx.gbl...
Hi Alan,

Thanks for the followup. Well, I recommend you use the "hidden iframe"
means.
As for your situation, you can make the refresh page(which refresh once 5
secs to serverside and query tables and update values in the page(you can
store them in some <input type="hidden" > fields.

then, embed this refresh page in the waiting page(display progress bar or
something else) via
<iframe id="frmRefresh " width="1" height="1" src="refresh.as px" >....
And you can use the javascript to retrieve the hidden fields(in the iframe
page)'s value and use it to update your display page.

To make it clearly, I've made two sample pages via C# code I've attached it in the message. You can get it if you view this thread via OE client.
Thanks.

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.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Nov 18 '05 #6
Hi Steve,
As for your situation, you can make the refresh page(which refresh once 5
secs to serverside and query tables and update values in the page(you can
store them in some <input type="hidden" > fields.<<

Right now I'm refreshing an entire datagrid with status values, not
individual fields.

Will I be able to use the refreshing datagrid on the Refresh page instead of
<input type="hidden" > fields?

I'm still experimenting with what you sent, but wanted to ask this question
in the meantime.

Thanks again..

Alan

"Steven Cheng[MSFT]" <v-******@online.m icrosoft.com> wrote in message
news:Wo******** ******@cpmsftng xa10.phx.gbl... Hi Alan,

Thanks for the followup. Well, I recommend you use the "hidden iframe"
means.
As for your situation, you can make the refresh page(which refresh once 5
secs to serverside and query tables and update values in the page(you can
store them in some <input type="hidden" > fields.

then, embed this refresh page in the waiting page(display progress bar or
something else) via
<iframe id="frmRefresh " width="1" height="1" src="refresh.as px" >....
And you can use the javascript to retrieve the hidden fields(in the iframe
page)'s value and use it to update your display page.

To make it clearly, I've made two sample pages via C# code I've attached it in the message. You can get it if you view this thread via OE client.
Thanks.

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.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Nov 18 '05 #7

Steven,

Thanks again for your reply and example.

I will go through it tomorrow.
only at the time the long-run operation has been finished, we display the final result to
the users, do you think so?


I would still like to be refreshing periodically all the way through, rather
than just at the end, since it is a batch process that could take up to
sever minutes, depending on the size of the date ranged covered by the
process.

This web app is duplicating an Access front end to SQLServer that users are
used to. I've been able to duplicate everything, else including
mulltiple-row edits of a datagrid, but this refresh part has been difficult
due to not being connected directly to the database.

When I make a little more progress, I will send you the url of the page
being refreshed.

Thanks again for your help.

Regards,

Alan

"Steven Cheng[MSFT]" <v-******@online.m icrosoft.com> wrote in message
news:$E******** *****@cpmsftngx a10.phx.gbl... Hi Alan,

Thanks for the followup. You mentioned that you'll need to query some
certain tables and retrieve out the datas and stored in a datagrid in the
refreshing page? I'm not sure whether you want to just display the changed
data in a datagrid and show to the users. If so, I think its also ok to put the datas in the datagrid on the refreshing page(in the iframe) and use
javascript to get the datagrid's clientside html and display in the
container page(waiting page) which is actually displayed to the users. I've attached my modified demo pages in this message regarding on this means.

Also, I also think since you use refreshing page and waiting page is just
to wait for a long-run operation to finish. So it's better that we put less displaying logic in refreshing page or waiting page, and only at the time
the long-run operation has been finished, we display the final result to
the users, do you think so?
If you have any updates, feel free to post here. Thanks.
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.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Nov 18 '05 #8
Hi Alan,

You're welcome. If you have any new findings or need any further help,
please feel free to post here .Thanks.
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.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
Nov 18 '05 #9
Steven,

I was able to get things working by swapping in my components into your
files. They were invaluable!

I have a couple questions remaining, but just now trashed my files somehow -
getting Fatal Engine Execution Error when try to open files in VS.NET.

After I rebuild them I will followup.

Thanks again.

Regards,

Alan

"Steven Cheng[MSFT]" <v-******@online.m icrosoft.com> wrote in message
news:3H******** ******@cpmsftng xa10.phx.gbl...
Hi Alan,

You're welcome. If you have any new findings or need any further help,
please feel free to post here .Thanks.
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.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Nov 18 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

66
3907
by: Ellinghaus, Lance | last post by:
> > Other surprises: Deprecating reload() >Reload doesn't work the way most people think >it does: if you've got any references to the old module, >they stay around. They aren't replaced. >It was a good idea, but the implementation simply >doesn't do what the idea promises. I agree that it does not really work as most people think it does, but how
6
8534
by: Dominic | last post by:
I have a home page on an intranet called default.asp I just type in the server name to take me to the default page http://server. The home page has an anchor name tag: <A name="fred">Freds Info</A> It is located by this anchor href tag: <A href="#fred">Up to Freds Info</A> The problem is that when I first use the link to take me up to Freds Info, the default.asp page is reloaded then I am taken to the Freds Info, which is a pain I...
19
31071
by: Darren | last post by:
I have a page that opens a popup window and within the window, some databse info is submitted and the window closes. It then refreshes the original window using window.opener.location.reload(). The problem is that after the reload, it brings you right to the top of the page. When I click 'refresh" on the original page, it brings me back to the original viewing position. Is there a way to duplicate this in from the popup window. Also,...
4
2520
by: N. Demos | last post by:
Hello, I'm learning ASP.NET, and am having a strange problem with some example code from the book I'm using. The code increments and displays the value stored in a session variable when the "Add" button is clicked. In addition, the session variable is reset to zero when the "Empty" button is pressed. The problem is if the value is non-zero and the page is reloaded the value is incremented. It appears as if the "Add" onClick event...
2
2830
by: gen_tricomi | last post by:
Python 2.4.2 (#67, Sep 28 2005, 12:41:11) on win32 Type "copyright", "credits" or "license()" for more information. **************************************************************** Personal firewall software may warn about the connection IDLE makes to its subprocess using this computer's internal loopback interface. This connection is not visible on any external interface and no data is sent to or received from the Internet....
1
13391
by: bernhard.voigt | last post by:
Hey! I'm using ipython as my python shell and often run scripts with the magic command %run: In : %run script.py If modules are loaded within the script these are not reloaded when I rerun the script. Hence, when I changed some of the modules loaded, I have to call
7
29647
by: J055 | last post by:
Hi I have a list on LinkButton controls on a page. When the link is clicked the LinkButton.Command event does a Server.Transfer to a page which writes binary to the HTTP output stream, e.g. a word document, pdf etc. Response.BinaryWrite(buffer); Response.End(); I would like to reload the page with the LinkButtons after this event to
14
2109
by: =?Utf-8?B?UGF1bA==?= | last post by:
Hi I tried a google search but could not find anything. I am trying to cause one webpage to reload when a second web page is closed. The second webpage loads data into a session variable and when closed I need to reload the first page loading in the data from the session variable. Since I need to close the sescond form just setting the post back url to the first page on the close button from the second page is not quite what I am looking...
0
9587
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9423
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10045
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9863
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8870
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3958
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3561
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.