page_load sometime execute twice with webbrowser conmtrol post

G

Guest

Hi Everyone,

I am using webbrowser control to post data to an aspx page. However, for
some reason, the aspx page sometimes will execute page_load event twice, and
sometimes execute it once. So I might get different results for executing it.

If I have the webbrwoser control to call it the first time, the aspx will
usually execute the page_load twice.

What can be the problem?

Thanks much in advance...
 
N

news.microsoft.com

In your page directive, is your AutoEventWireup set to true or false? If it
is set to true, set it equal to false. Are you doing any Response.Redirects
in your code anywhere?
 
G

Guest

Alex,
In my page directive, AutoEventWireup is set to false.
Yes I have Response.Redirects at the end of the page_load, and I am using
Response.Redirect ("nextpage.aspx", false); to avoid ThreadAbortException
exception. I was suspecting that has something to do with the behavior of the
page, but was not sure why.

Thanks,
Julia
 
A

Alex

Julia,

Without seeing your code, I can say from my experiences that I came across
situations where I thought the Page_Load was being called twice. The reason
this was true, or seemed like it, was because I had Response.Redirects in my
page. Sometimes it throws a logic wrench into the gears and it makes you
wonder what's going on. If you step through your Redicts, you may find that
it working as the codes says it should. Are you having any issues where
there are duplicate control populations or anything? What's your page_load
function look like, if it's not too big to post?
 
G

Guest

Alex,

You're right on it.

The main Response.Redirect did in return calling page_load function again
sometimes, and this is preplexing to me. If I am redirecting it to an asp
page that is has no relationship to this aspx page, what would cause it to
call this aspx page again? Any pointers?

Thanks so much,
Julia
 

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

Similar Threads

Page_Load 1
Webbrowser Parameters 6
Code in Page_Load executes twice 5
Page_Load fired twice via ProcessRequest 0
PAGE_LOAD fired twice 2
Page_Load & ButtonClick? 17
Page_Load gets called twice 12
Page_Load 3

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top