Results 1 to 5 of 5

Thread: How to programmatically refresh a page in asp.net?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 2004
    Location
    malaysia
    Posts
    89

    Question How to programmatically refresh a page in asp.net?

    hi, guys,
    i have a simple problem to ask

    let say i have a webform name: a.aspx
    and i have a button name: btnA

    when the user click btnA, i would like to refresh the a.aspx, how can i do that?

    assumption: btnA is a control within the a.aspx and i dont want auto refresh in metadata setting.

    thx.

  2. #2
    Addicted Member rdove's Avatar
    Join Date
    Dec 2002
    Location
    Indianapolis
    Posts
    251

    Re: How to programmatically refresh a page in asp.net?

    Code:
        Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    
            Button1.Attributes.Add("onclick", "<script language=javascript1.2>window.location.reload(true);</script>")
    
        End Sub
    ~Ryan





    Have I helped you? Please Rate my posts.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    May 2004
    Location
    malaysia
    Posts
    89

    Unhappy Re: How to programmatically refresh a page in asp.net?

    thanx for you replied, rdove.

    i folllow your code, but i cannnot refresh.

    however, all my code are written in codebehind.

    can you give me a more detail coding about the example you give me?

  4. #4
    Banned jhermiz's Avatar
    Join Date
    Jun 2002
    Location
    Antarctica
    Posts
    2,492

    Re: How to programmatically refresh a page in asp.net?

    Quote Originally Posted by kkc
    thanx for you replied, rdove.

    i folllow your code, but i cannnot refresh.

    however, all my code are written in codebehind.

    can you give me a more detail coding about the example you give me?
    Why dont you redirect back to the same page ??????

    Response.Redirect("yourPage")

    Jon

  5. #5

    Thread Starter
    Lively Member
    Join Date
    May 2004
    Location
    malaysia
    Posts
    89

    Re: How to programmatically refresh a page in asp.net?

    because i want to refresh a.aspx to remove all the session variable in a.aspx before i redirect back to a previous page.

    i.e
    i use "b.aspx" response.redirect to a.apsx
    and i use the session variable from b.aspx pass to a.aspx,
    the session variable passed to a.aspx was used as a logic flow control so that other user cannot directly a.aspx url to enter the a.aspx page



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width