469,898 Members | 1,437 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,898 developers. It's quick & easy.

page_load sometime execute twice with webbrowser conmtrol post

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...
Nov 18 '05 #1
4 2798
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?
--
Alex Mueller

"Julia" <Ju***@discussions.microsoft.com> wrote in message
news:2A**********************************@microsof t.com...
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...

Nov 18 '05 #2
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
"news.microsoft.com" wrote:
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?
--
Alex Mueller

"Julia" <Ju***@discussions.microsoft.com> wrote in message
news:2A**********************************@microsof t.com...
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...


Nov 18 '05 #3
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?

--
Alex Mueller

"Julia" <Ju***@discussions.microsoft.com> wrote in message
news:3E**********************************@microsof t.com...
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
"news.microsoft.com" wrote:
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?
--
Alex Mueller

"Julia" <Ju***@discussions.microsoft.com> wrote in message
news:2A**********************************@microsof t.com...
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...


Nov 18 '05 #4
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

"Alex" wrote:
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?

--
Alex Mueller

"Julia" <Ju***@discussions.microsoft.com> wrote in message
news:3E**********************************@microsof t.com...
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
"news.microsoft.com" wrote:
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?
--
Alex Mueller

"Julia" <Ju***@discussions.microsoft.com> wrote in message
news:2A**********************************@microsof t.com...
> 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...


Nov 18 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by Andy | last post: by
7 posts views Thread by Nimrod Cohen | last post: by
3 posts views Thread by erdem | last post: by
14 posts views Thread by V. Jenks | last post: by
17 posts views Thread by Arpan | last post: by
4 posts views Thread by David C | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.