473,408 Members | 1,907 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

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 2975
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Andy | last post by:
Visual Studio 2003 web form problem using C#. My Page_Load or OnInit routines seems to be called twice for every post back to the server. I have 2 web forms that produce this behaviour, all of...
1
by: Jon | last post by:
Hi, I've set up a new web form (new.aspx) that inherits a BasePage class. The new web form contains an override Page_Load event. In BasePage, Page_Load is declared 'virtual'. In the new web...
1
by: bminder | last post by:
In the asp.net pages below, Common.vb has an overridable Page_Load sub. In the consuming page, Two.aspx, the Page_Load sub is inherited, but for some reason it (Overrides Sub Page_Load) executes...
7
by: Nimrod Cohen | last post by:
Hi During the page_load of my Aspx page "http://myMachine/MyWebApp/Quote.aspx" , i write to the response an html that embeds a form with the action pointing out to the same aspx page i.e...
3
by: erdem | last post by:
hi, i have a problem with asp.net when i was debugging i put breakpoint to pageload event and then i discovered that page is loaded once (explorer shows full page correctly but continues...
2
by: magister | last post by:
Does smartnavigation on parent page make user controls page_load twice... Any fixes for this!!! Problem is when boss sees smartnavigation he likes but it causes lots of other bugs....why...
14
by: V. Jenks | last post by:
I'm a little rusty having not touched .NET for 6 months and I can't remember why Page_Load is happening twice in this code: private void Page_Load(object sender, System.EventArgs e) {...
17
by: Arpan | last post by:
When a Button is clicked in a Web Form in an ASPX page, the Form will post back to itself. Under such circumstances (i.e. when a Button is clicked), will the Page_Load sub execute first & then will...
4
by: David C | last post by:
I spent the last four hours trying to figure out why Page_Load would execute twice. Even stranger was that everything within if (! IsPostBack){....} executed twice as well. There is no rhyme or...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.