Page Reload

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
 
D

Dunc

Just redirect back to it?

protected void btnReload(object sender, EventArgs e)
{
Response.Redirect("mypage.aspx");
}
 
A

Andy

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,188
Latest member
Crypto TaxSoftware

Latest Threads

Top