Page Load

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
 
B

Bill McCarthy

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
 
S

Scott M.

How does this stop the postback from occurring (which is what I think the OP
wants).
 
S

Scott M.

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.
 
A

ats@jbex

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
 
R

rowe_newsgroups

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
 
C

Cor Ligthert[MVP]

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
 
R

rowe_newsgroups

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
 
C

Cor Ligthert[MVP]

Rowe,

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

:)

Cor
 
R

rowe_newsgroups

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

No mercy!

:)

Thanks,

Seth Rowe
 

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

Top