Programmatically Refreshing the Page

Discussion in 'ASP .Net Building Controls' started by Nathan Sokalski, Aug 13, 2005.

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

    http://www.nathansokalski.com/
     
    Nathan Sokalski, Aug 13, 2005
    #1
    1. Advertising

  2. 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
     
    Cor Ligthert [MVP], Aug 13, 2005
    #2
    1. Advertising

  3. 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" <> wrote in message
    news:...
    > 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
    >
    > http://www.nathansokalski.com/
    >
     
    Larry F. Burge, Aug 13, 2005
    #3
    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. Nathan Sokalski

    Programmatically Refreshing the Page

    Nathan Sokalski, Aug 13, 2005, in forum: ASP .Net
    Replies:
    10
    Views:
    14,582
    Ritesh Singh
    Aug 20, 2005
  2. Harlan Messinger

    Self-refreshing and non-self-refreshing controls

    Harlan Messinger, Aug 4, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    483
    =?Utf-8?B?Y2xpY2tvbg==?=
    Aug 4, 2006
  3. Nathan Sokalski

    Programmatically Refreshing the Page

    Nathan Sokalski, Aug 13, 2005, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    111
    Larry F. Burge
    Aug 13, 2005
  4. Harlan Messinger

    Self-refreshing and non-self-refreshing controls

    Harlan Messinger, Aug 3, 2006, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    213
    Harlan Messinger
    Aug 3, 2006
  5. Replies:
    2
    Views:
    142
Loading...

Share This Page