One thing that I have often needed to do that I have been unable to find a
way to do is refresh the page (basically do the same thing as pressing the
browser's Refresh button). I know how to do this using Javascript/JScript,
but I have situations in which I need it to be done immediately after code
that is part of my other code. Is there any way to do this? Thanks.
--
Nathan Sokalski
njsokalski@hotmail.com
http://www.nathansokalski.com/

Re: Programmatically Refreshing the Page by shiv_koirala

shiv_koirala
Fri Aug 12 22:48:36 CDT 2005

Hi

Do not know if i am correct did u try meta refresh tag of HTML.



Shivprasad Koirala
C# , VB.NET , SQL SERVER , ASP.NET Interview Questions
http://www.geocities.com/dotnetinterviews/


Re: Programmatically Refreshing the Page by Nathan

Nathan
Fri Aug 12 23:40:56 CDT 2005

You seem to have misunderstood my question. I want the refreshing to occur
when, and only when, it is called in my code. For example, I might have a
graphic that gets changed when the user presses a button. They do not see
the new graphic unless the page is refreshed. I want to be able to
automatically refresh the page after the graphic is modified, but I don't
want the page to be continually refreshed, because that would be inefficient
and mean that the user might need to wait a certain period of time
(depending on how frequently I set the meta tag to refresh) before seeing
the new graphic.
--
Nathan Sokalski
njsokalski@hotmail.com
http://www.nathansokalski.com/

<shiv_koirala@yahoo.com> wrote in message
news:1123904916.645353.180630@o13g2000cwo.googlegroups.com...
> Hi
>
> Do not know if i am correct did u try meta refresh tag of HTML.
>
>
>
> Shivprasad Koirala
> C# , VB.NET , SQL SERVER , ASP.NET Interview Questions
> http://www.geocities.com/dotnetinterviews/
>



Re: Programmatically Refreshing the Page by Lucas

Lucas
Fri Aug 12 23:55:05 CDT 2005

"Nathan Sokalski" <njsokalski@hotmail.com> wrote in
news:u6FBvE8nFHA.3256@TK2MSFTNGP12.phx.gbl:

> You seem to have misunderstood my question. I want the refreshing to
> occur when, and only when, it is called in my code.

I think you have a misunderstanding of how the web works... The web works
in a request-response fashion, only clients can make requests for data.
Hence, the server (ASP.NET) can force a refresh.

There are a couple solution to emulate what you want:

1. Refresh continously
2. Poll the server via javascript remoting, when the server returns a
positive response, refresh thte apge

Option 1 is easy. Option 2 takes some knowledge of javascript.

--
Lucas Tam (REMOVEnntp@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/

Re: Programmatically Refreshing the Page by Cor

Cor
Sat Aug 13 01:56:31 CDT 2005

Nathan,

I assume that the other sample I did sent in your other questions give you
an answer on this?

I hope this helps,

Cor



Re: Programmatically Refreshing the Page by shiv_koirala

shiv_koirala
Sat Aug 13 03:07:37 CDT 2005

Ok got it then you can use Cache object where you can specify when the
object changes referesh the cache.

Cache object can further be customized on lot of parameter like values
, time , change in file etc etc.



Shivprasad Koirala
C# , VB.NET , SQL SERVER , ASP.NET Interview Questions
http://www.geocities.com/dotnetinterviews/


Re: Programmatically Refreshing the Page by Juan

Juan
Sat Aug 13 06:58:43 CDT 2005

Hi, Nathan.

You might want to take a look at:
"Generating Client-Side Script for Postback"

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpcongeneratingclient-sidejavascriptforpostback.asp

That article explains how to generate a postback event
in controls other than buttons and image buttons.

Make sure you follow through to the accompanying article:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconpostbackusingjavascriptsample.asp

That sample creates a custom link button
that initiates postback through client-side script.

For a sample which derives from WebControl,
see "Rendering a Server Control Samples" :

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconrenderingservercontrolssamples.asp

I see what might be a problem in using these methods, and it's that
synchronizing the client-side script so that it executes *after* your
new image has been created might be tricky.

You might want to consider adding a "Please wait..." message
or a progress bar to your code and introducing a time delay
for the postback to occur, so that enough time elapses before
the page is refreshed by the postback.

For "Please wait..." and progress bar example code, see :

http://www.daveandal.net/books/6744/loadpost/simplewait.aspx
http://www.daveandal.net/books/6744/loadpost/progressbar.aspx

There's links to source code in both.



Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================

"Nathan Sokalski" <njsokalski@hotmail.com> wrote in message
news:u6FBvE8nFHA.3256@TK2MSFTNGP12.phx.gbl...
> You seem to have misunderstood my question. I want the refreshing to occur when, and
> only when, it is called in my code. For example, I might have a graphic that gets
> changed when the user presses a button. They do not see the new graphic unless the page
> is refreshed. I want to be able to automatically refresh the page after the graphic is
> modified, but I don't want the page to be continually refreshed, because that would be
> inefficient and mean that the user might need to wait a certain period of time
> (depending on how frequently I set the meta tag to refresh) before seeing the new
> graphic.
> --
> Nathan Sokalski
> njsokalski@hotmail.com
> http://www.nathansokalski.com/
>
> <shiv_koirala@yahoo.com> wrote in message
> news:1123904916.645353.180630@o13g2000cwo.googlegroups.com...
>> Hi
>>
>> Do not know if i am correct did u try meta refresh tag of HTML.
>>
>>
>>
>> Shivprasad Koirala
>> C# , VB.NET , SQL SERVER , ASP.NET Interview Questions
>> http://www.geocities.com/dotnetinterviews/
>>
>
>



Re: Programmatically Refreshing the Page by Larry

Larry
Sat Aug 13 09:46:40 CDT 2005

I'm not sure if this will help but; this is what I do when I want the page
to be refreshed. It is server based, I find it nessary if a resource on the
server has changed and I want it reflected in the browser.

Public Shared Sub RefreshPage()
Dim httpCxt As System.Web.HttpContext = GetHTTPContext()
httpCxt.Response.Redirect(httpCxt.Request.RawUrl) ' RawUrl contains
the full url, including parameters.
End Sub

Public Shared Function GetHTTPContext() As System.Web.HttpContext
Return (System.Web.HttpContext.Current)
End Function


"Nathan Sokalski" <njsokalski@hotmail.com> wrote in message
news:eH0ql66nFHA.3408@tk2msftngp13.phx.gbl...
> One thing that I have often needed to do that I have been unable to find a
> way to do is refresh the page (basically do the same thing as pressing the
> browser's Refresh button). I know how to do this using Javascript/JScript,
> but I have situations in which I need it to be done immediately after code
> that is part of my other code. Is there any way to do this? Thanks.
> --
> Nathan Sokalski
> njsokalski@hotmail.com
> http://www.nathansokalski.com/
>



Re: Programmatically Refreshing the Page by Stuart

Stuart
Tue Aug 16 13:53:49 CDT 2005

Quick and dirty:

Use SendKeys to send an {f5} to the IE window - bingo
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemWindowsFormsSendKeysClassTopic.asp

Good luck

"Nathan Sokalski" <njsokalski@hotmail.com> wrote in message
news:u6FBvE8nFHA.3256@TK2MSFTNGP12.phx.gbl...
> You seem to have misunderstood my question. I want the refreshing to occur
> when, and only when, it is called in my code. For example, I might have a
> graphic that gets changed when the user presses a button. They do not see
> the new graphic unless the page is refreshed. I want to be able to
> automatically refresh the page after the graphic is modified, but I don't
> want the page to be continually refreshed, because that would be
> inefficient and mean that the user might need to wait a certain period of
> time (depending on how frequently I set the meta tag to refresh) before
> seeing the new graphic.
> --
> Nathan Sokalski
> njsokalski@hotmail.com
> http://www.nathansokalski.com/
>
> <shiv_koirala@yahoo.com> wrote in message
> news:1123904916.645353.180630@o13g2000cwo.googlegroups.com...
>> Hi
>>
>> Do not know if i am correct did u try meta refresh tag of HTML.
>>
>>
>>
>> Shivprasad Koirala
>> C# , VB.NET , SQL SERVER , ASP.NET Interview Questions
>> http://www.geocities.com/dotnetinterviews/
>>
>
>