PDA

Click to See Complete Forum and Search --> : How to programmatically refresh a page in asp.net?


kkc
Dec 17th, 2004, 10:04 AM
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.
:wave:

rdove
Dec 17th, 2004, 02:22 PM
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

kkc
Dec 19th, 2004, 08:07 AM
thanx for you replied, rdove.

i folllow your code, but i cannnot refresh. :blush:

however, all my code are written in codebehind.

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

jhermiz
Dec 19th, 2004, 10:54 AM
thanx for you replied, rdove.

i folllow your code, but i cannnot refresh. :blush:

however, all my code are written in codebehind.

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

Why dont you redirect back to the same page ??????

Response.Redirect("yourPage")

Jon

kkc
Dec 20th, 2004, 01:23 AM
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


:blush: