Page Reload

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello All,

I want to Reload the Page, i mean to say when a button is clicked i want to
run the code even written with in the If Not Page.IsPostback then.

Help me how can i do that.

Shiva Kumar
 
Just redirect back to it?

protected void btnReload(object sender, EventArgs e)
{
Response.Redirect("mypage.aspx");
}
 
If the code that runs on the first time the page is loaded is supposed
to also run when the page is posted back, then move the code out of
the if Not Page.IsPostback statement and make it plain drop-thru code
in the Page_Load function.


ie

if not Page.IsPostback then
strText="runs only when page is first loaded and it I want it to
run when page is posted"
strText="I only want this to run when page is loaded"
else
strText="runs only when page is posted"
end if


should be


strText="runs only when page is first loaded and it I want it to run
when page is posted"
if not Page.IsPostback then
strText="I only want this to run when page is loaded"
else
strText="runs only when page is posted"
end if
 
Back
Top