Page Load

  • Thread starter Thread starter ats@jbex
  • Start date Start date
A

ats@jbex

I ahve a webpage that has some calls to procedures in it's Load Event.It
also has a tab strip on it. Whenever I click a tab on the page, the Page
Load event fires again. Is there a way to stop this from happening?

TIA

--
ats@jbex

It's easy to lay down and hide
Where's the warrior without his pride?

Adam and The Ants - Dog Eat Dog
 
Hi,

You should be able to just check if the page .IsPostBack, eg.

Sub Page_Load
If page.IsPostBack Then return
'rest of code here
End Sub
 
How does this stop the postback from occurring (which is what I think the OP
wants).
 
The fact that you are in a web app and now a Windows app means that when you
use the web form controls, they must post back to the server to perform some
action. This is what is happening with your tab strip.
 
The fact that you are in a web app and now a Windows app means that when you
use the web form controls, they must post back to the server to perform some
action. This is what is happening with your tab strip.

Thanks to all for the help. I have now got a check for Page.IsPostBack and
if it is then it no longer calls all of my procedures. This has fixed the
problem mostly.

--
ats@jbex

Those who died are justified, for wearing the badge, they're the chosen
whites
You justify those that died by wearing the badge, they're the chosen whites

Rage Against The Machine - Killing In The Name
 
How does this stop the postback from occurring (which is what I think the OP
wants).

I'm pretty sure OP wasn't asking about how to prevent postbacks - as
that would defeat the entire purpose of ASP.Net's server side modal. I
think the OP just wanted to know how to conditional execute code in
the Load method.

Thanks,

Seth Rowe
 
Ats,

Interesting, and how do you recognise a real postback now?

Are you sure that you have no redirects which are starting and it is about
new pages?

Cor
 
Are you sure that you have no redirects which are starting and it is about
new pages?

IIRC Response.Redirect causes the client to send a GET request for the
page not a POST request so the code will execute like normal in the
OP's Page_Load handler.

Thanks,

Seth Rowe
 
Rowe,

I realized me that a redirect is a new page. However you did not give me the
time to correct this.

:-)

Cor
 
However you did not give me the time to correct this.

No mercy!

:-)

Thanks,

Seth Rowe
 
Back
Top