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.
:wave:
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
Re: How to programmatically refresh a page in asp.net?
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:
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. :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
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
:blush: