473,781 Members | 2,732 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
18 10146
Steven,

1. Just a note to thank you for your help and sample files on the
Refresh/iFrame method of handling async calls.

Everything is working fine.

1. I have one question remaining:

Is there a way to programmaticall y turn the http-equiv = "refresh" on and
off?

Or some equivalent JScript method?

Thanks.

Alan
Nov 18 '05 #11
Hi Alan,

Thanks for the followup. To answer your question:

1. I have no idea how to control the http-equiv = "refresh" meta of the
page
2. Of course ,we can use javascript code to post a page after a certain
period of time. The
window.setTimeo ut function is just for such function. For example:
We define the following function "setTimer() " and in it we add the
window.setTimeo ut("document.fo rms[0].submit()",1000 );
which indicate that the page will be submit 1 second later after we call
this function.

<script language="javas cript">

function setTimer()
{
window.setTimeo ut("document.fo rms[0].submit()",1000 );
}

</script>
Then, we can call this function at the page's clientside's onload event,
just like:
<body onload="setTime r()" >

And if we want to control whether to call it or not at serverside. We can
use
Page.RegisterSt artupScript method to programmaticall y add this script call,
just as below:

private void Page_Load(objec t sender, System.EventArg s e)
{
Page.RegisterSt artupScript("se tTimer","<scrip t
language='javas cript'>setTimer ();</script>");
}

Hope this helps. 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 #12


Steven,

Thanks again for the detailed example.

I will try it out and let you know how it goes.

Regards,

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

Thanks for the followup. To answer your question:

1. I have no idea how to control the http-equiv = "refresh" meta of the
page
2. Of course ,we can use javascript code to post a page after a certain
period of time. The
window.setTimeo ut function is just for such function. For example:
We define the following function "setTimer() " and in it we add the
window.setTimeo ut("document.fo rms[0].submit()",1000 );
which indicate that the page will be submit 1 second later after we call
this function.

<script language="javas cript">

function setTimer()
{
window.setTimeo ut("document.fo rms[0].submit()",1000 );
}

</script>
Then, we can call this function at the page's clientside's onload event,
just like:
<body onload="setTime r()" >

And if we want to control whether to call it or not at serverside. We can
use
Page.RegisterSt artupScript method to programmaticall y add this script call, just as below:

private void Page_Load(objec t sender, System.EventArg s e)
{
Page.RegisterSt artupScript("se tTimer","<scrip t
language='javas cript'>setTimer ();</script>");
}

Hope this helps. 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 #13
Hi Steven,

I realized what I'd like to do is the following:

1. Right now, my Progress page has six async calls and completion handlers.
The Refresh page is continually refreshing every 5 seconds and is contained
in the Progress page as an iFrame..

2. Instead of the continual refreshes of the Refresh page, I would like to
call a refresh (Submit) of the Refresh page as part of each completion
handler on the main Progress page.

That way, the Refresh page would only refresh at completion of each of the
six async routines.

3. Is this possible, i.e. either

(a) calling a "submit" of the iFrame on the Progress page, or

(b) passing a submit command through to the Refresh page from the Progress
page completion handlers?

Thanks again for your help and examples.

Regards,

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

Thanks for the followup. To answer your question:

1. I have no idea how to control the http-equiv = "refresh" meta of the
page
2. Of course ,we can use javascript code to post a page after a certain
period of time. The
window.setTimeo ut function is just for such function. For example:
We define the following function "setTimer() " and in it we add the
window.setTimeo ut("document.fo rms[0].submit()",1000 );
which indicate that the page will be submit 1 second later after we call
this function.

<script language="javas cript">

function setTimer()
{
window.setTimeo ut("document.fo rms[0].submit()",1000 );
}

</script>
Then, we can call this function at the page's clientside's onload event,
just like:
<body onload="setTime r()" >

And if we want to control whether to call it or not at serverside. We can
use
Page.RegisterSt artupScript method to programmaticall y add this script call, just as below:

private void Page_Load(objec t sender, System.EventArg s e)
{
Page.RegisterSt artupScript("se tTimer","<scrip t
language='javas cript'>setTimer ();</script>");
}

Hope this helps. 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 #14
Hi Alan,

Thanks for the response. As for the #1 and #2 in your further description,
I don't think they're possible. You means you want to refresh the iframe
page only when the async call finish? Then, I wonder how you make the async
call ,at clientside or at serverside? If at serverside, since the web based
application is request/response mode, we can't get the async call 's call
back and the only way is to constantly refresh the page(post back to
server) to query the serverside state info, do you think so?

As for the
=============== ============
(a) calling a "submit" of the iFrame on the Progress page, or

(b) passing a submit command through to the Refresh page from the Progress
page completion handlers?
=============== ============
you mentioned, do you mean using javascript to post back the iframe page ?
If so, this is ok, we can referece the iframe element in the Progress page
via
var frm = document.getEle mentById(iframe Id);

Then call
frm.document.fo rms[0].submit(); to submit the iframe page(refresh page).

In fact, this is the general javascript skills. Here are some web resources
on manipulating iframe in javascript

http://developer.netscape.com/suppor...ascript.html#4
http://www.quirksmode.org/js/iframe.html
http://www.xs4all.nl/~ppk/js/iframe.html

############### ####

In addition, I'm not sure whether you've ever trying calling webservice via
DHTML javascript in web page? This is also a means to call serverside
webservice in clientside script so as to prevent page be postedback to
server. Here is the reference in MSDN:

#Accessing Web Services From DHTML
http://msdn.microsoft.com/library/en...01.asp?frame=t
rue

http://msdn.microsoft.com/library/de...thor/webservic
e/overview.asp
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 #15
Hi Steven,

Thanks again very much for your examples and the references. Your help has
been invaluable!

Regards,

Alan

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

Thanks for the response. As for the #1 and #2 in your further description,
I don't think they're possible. You means you want to refresh the iframe
page only when the async call finish? Then, I wonder how you make the async call ,at clientside or at serverside? If at serverside, since the web based application is request/response mode, we can't get the async call 's call
back and the only way is to constantly refresh the page(post back to
server) to query the serverside state info, do you think so?

As for the
=============== ============
(a) calling a "submit" of the iFrame on the Progress page, or

(b) passing a submit command through to the Refresh page from the Progress
page completion handlers?
=============== ============
you mentioned, do you mean using javascript to post back the iframe page ?
If so, this is ok, we can referece the iframe element in the Progress page
via
var frm = document.getEle mentById(iframe Id);

Then call
frm.document.fo rms[0].submit(); to submit the iframe page(refresh page).

In fact, this is the general javascript skills. Here are some web resources on manipulating iframe in javascript

http://developer.netscape.com/suppor...ascript.html#4
http://www.quirksmode.org/js/iframe.html
http://www.xs4all.nl/~ppk/js/iframe.html

############### ####

In addition, I'm not sure whether you've ever trying calling webservice via DHTML javascript in web page? This is also a means to call serverside
webservice in clientside script so as to prevent page be postedback to
server. Here is the reference in MSDN:

#Accessing Web Services From DHTML
http://msdn.microsoft.com/library/en...01.asp?frame=t rue

http://msdn.microsoft.com/library/de...thor/webservic e/overview.asp
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 #16
Hello,

Would it be possible for you to send me these examplea as I can’t see them attached in posts?
Nov 18 '05 #17
Hello

I could be going mad here but the link

http://msdn.microsoft.com/newsgroups...bd-57287813491

Shows only text no examples, could you please send me these as I seem to be trying to do exactly what you have done her

:-)
Nov 18 '05 #18
Try using outlookexpress as your newsgroup reader.

It should pick up the attachments.

That may be your problem.

The server address is msnews.microsof t.com

Alan
"David P" <da**********@h otmail.com> wrote in message
news:22******** *************** ***********@mic rosoft.com...
Hello,

I could be going mad here but the link

http://msdn.microsoft.com/newsgroups...d-57287813491d
Shows only text no examples, could you please send me these as I seem to be trying to do exactly what you have done here
:-)

Nov 18 '05 #19

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

Similar topics

66
3908
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
31072
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
2832
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
2110
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
9474
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,...
1
10076
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9939
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
8964
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...
1
7486
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6729
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5375
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3633
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2870
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.