473,386 Members | 1,673 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,386 software developers and data experts.

most unbelievable phenomenon

Here's what happening.
On 'page1.aspx' I redirect to 'page2.aspx':
Response.Redirect("page2.aspx", true);

On 'page2.aspx' I'm redirecting to 'page3.aspx':
Response.Redirect("page3.aspx", true);

When page 'page3.aspx' 'Page_Load' completes it
also calls 'Page_Load' of page 'page1.aspx'.(bizzare)
Please understand that I in no way am calling it.

What is going on?!!!!!!!

I found all that while debugging with breakpoints in all form's 'Page_Load'
events.
By the way, 'page2.aspx' never calls 'page1.aspx', only 'page3.aspx'.

Any insight?
Thanks,
Oleg
Dec 7 '05 #1
11 1120
Redirecting and stopping execution are 2 different things. That is,
Response.Redirect sends an HTTP Redirect message to the client. It doesn't
say "Stop program execution here." Page 1's code isn't being called from
anything. It's just continuing.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
You can lead a fish to a bicycle,
but you can't make it stink.

"Oleg" <Ol**@discussions.microsoft.com> wrote in message
news:A4**********************************@microsof t.com...
Here's what happening.
On 'page1.aspx' I redirect to 'page2.aspx':
Response.Redirect("page2.aspx", true);

On 'page2.aspx' I'm redirecting to 'page3.aspx':
Response.Redirect("page3.aspx", true);

When page 'page3.aspx' 'Page_Load' completes it
also calls 'Page_Load' of page 'page1.aspx'.(bizzare)
Please understand that I in no way am calling it.

What is going on?!!!!!!!

I found all that while debugging with breakpoints in all form's
'Page_Load'
events.
By the way, 'page2.aspx' never calls 'page1.aspx', only 'page3.aspx'.

Any insight?
Thanks,
Oleg

Dec 7 '05 #2
Huh?
I was under the impression after redirect nothing get's executed, ASP.NET
aborts.
Also like when using Response.end
Will have to verify that again.
"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> schreef in bericht
news:uG***************@tk2msftngp13.phx.gbl...
Redirecting and stopping execution are 2 different things. That is,
Response.Redirect sends an HTTP Redirect message to the client. It doesn't
say "Stop program execution here." Page 1's code isn't being called from
anything. It's just continuing.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
You can lead a fish to a bicycle,
but you can't make it stink.

"Oleg" <Ol**@discussions.microsoft.com> wrote in message
news:A4**********************************@microsof t.com...
Here's what happening.
On 'page1.aspx' I redirect to 'page2.aspx':
Response.Redirect("page2.aspx", true);

On 'page2.aspx' I'm redirecting to 'page3.aspx':
Response.Redirect("page3.aspx", true);

When page 'page3.aspx' 'Page_Load' completes it
also calls 'Page_Load' of page 'page1.aspx'.(bizzare)
Please understand that I in no way am calling it.

What is going on?!!!!!!!

I found all that while debugging with breakpoints in all form's
'Page_Load'
events.
By the way, 'page2.aspx' never calls 'page1.aspx', only 'page3.aspx'.

Any insight?
Thanks,
Oleg


Dec 7 '05 #3
My mistake, Edwin. It does end execution, under normal circumstances. I was
thinking about the "EndResponse" parameter. However, upon further research,
I saw that it can raise an HttpException if it is called after the Http
Headers have been sent to the client. I'm not sure whether or not this might
cause the method to be interrupted and not call Response.End. If so, that
might be the cause of the issue.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
You can lead a fish to a bicycle,
but you can't make it stink.

"Edwin Knoppert" <in**@pbsoft.speedlinq.nl> wrote in message
news:dn**********@azure.qinip.net...
Huh?
I was under the impression after redirect nothing get's executed, ASP.NET
aborts.
Also like when using Response.end
Will have to verify that again.
"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> schreef in bericht
news:uG***************@tk2msftngp13.phx.gbl...
Redirecting and stopping execution are 2 different things. That is,
Response.Redirect sends an HTTP Redirect message to the client. It
doesn't say "Stop program execution here." Page 1's code isn't being
called from anything. It's just continuing.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
You can lead a fish to a bicycle,
but you can't make it stink.

"Oleg" <Ol**@discussions.microsoft.com> wrote in message
news:A4**********************************@microsof t.com...
Here's what happening.
On 'page1.aspx' I redirect to 'page2.aspx':
Response.Redirect("page2.aspx", true);

On 'page2.aspx' I'm redirecting to 'page3.aspx':
Response.Redirect("page3.aspx", true);

When page 'page3.aspx' 'Page_Load' completes it
also calls 'Page_Load' of page 'page1.aspx'.(bizzare)
Please understand that I in no way am calling it.

What is going on?!!!!!!!

I found all that while debugging with breakpoints in all form's
'Page_Load'
events.
By the way, 'page2.aspx' never calls 'page1.aspx', only 'page3.aspx'.

Any insight?
Thanks,
Oleg



Dec 7 '05 #4
KJ
This can also happen if Page3 inherits from Page1, e.g., public class
Page3 : Page1 (C#).

Dec 8 '05 #5
KJ
This can also happen if Page3 inherits from Page1, e.g., public class
Page3 : Page1 (C#).

Dec 8 '05 #6
KJ
This can also happen if Page3 inherits from Page1, e.g., public class
Page3 : Page1 (C#).

Dec 8 '05 #7
KJ is probably the closest to the truth here.
Although I checked for inheretance and it's not the case.
They both inherit from the same page.
Even with inheritance, I would expect Page1's 'Page_Load' run before
Page3 'Page_Load'. But it happens vise versa.
I'll try to reboot and update you on the status tomorrow.
Oleg

"KJ" wrote:
This can also happen if Page3 inherits from Page1, e.g., public class
Page3 : Page1 (C#).

Dec 8 '05 #8
Kevin Spencer wrote:
My mistake, Edwin. It does end execution, under normal circumstances. I was
thinking about the "EndResponse" parameter. However, upon further research,
I saw that it can raise an HttpException if it is called after the Http
Headers have been sent to the client. I'm not sure whether or not this might
cause the method to be interrupted and not call Response.End. If so, that
might be the cause of the issue.

Or if there is a too general exception handler wrapping the
Response.Redirect, then execution will continue into the catch and any
code thereafter.

Damien

Dec 8 '05 #9
the thing is, it even calls Page1 even on the postback of the Page3.
How is that possible?
Oleg

"Oleg" wrote:
KJ is probably the closest to the truth here.
Although I checked for inheretance and it's not the case.
They both inherit from the same page.
Even with inheritance, I would expect Page1's 'Page_Load' run before
Page3 'Page_Load'. But it happens vise versa.
I'll try to reboot and update you on the status tomorrow.
Oleg

"KJ" wrote:
This can also happen if Page3 inherits from Page1, e.g., public class
Page3 : Page1 (C#).

Dec 8 '05 #10
I finally found an answer or solution rather to my problem!!!!

In my application Properties -> Documents Page1.aspx was
on the top of the list. So I removed it from there list.
No more problems!!!!!
Go figure.

Oleg
Dec 8 '05 #11
KJ
Postbacks still trigger the page events for inherited classes (pages).
But you state that you are not inheriting, so perhaps that's not a
response relevant to the question.

Dec 8 '05 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Lynn & Lilibeth | last post by:
ATTENTION; Finding it tough to make money on the Internet? Want to know some well guarded secrets that will essentially make all the difference between not making money and earning a good...
4
by: Eric | last post by:
I found the following phenomenon in VC++ 2005: struct A {}; struct B : public A { virtual ~B() {} }; A* p = new B;
27
by: Servé Lau | last post by:
in what fields of computing is C used the most nowadays? embedded, scientific, applications? What?
132
by: Kevin Spencer | last post by:
About 2 years ago, and as recently as perhaps 1 year ago, I can recall seeing many posts about what language to use with ASP.Net. The consensus was that employers paid more for C# programmers, and...
2
by: Eddie | last post by:
Hi I am trying to soleve the following problem using an asp recordset (connects to sql) A column in the recordset contains integers between 1 and 5. I am trying to find a way of concluding which...
4
by: Bobby | last post by:
You would think that with all the bad press Windows gets from whiners and people who think that Linux is superior, people would be leary of Microsoft by now. However, it is #7 on Fortune's list of...
0
by: U S Contractors Offering Service A Non-profit | last post by:
Brilliant technology helping those most in need Inbox Reply U S Contractors Offering Service A Non-profit show details 10:37 pm (1 hour ago) Brilliant technology helping those most in need ...
2
by: robert.waters | last post by:
I need to perform the following: - select the most recent X number of records in a table (there is a timestamp field) - select the Nth occurrence of X number of records ex: - most recent 10...
4
by: zacks | last post by:
Most applications whose purpose is to work with various types of files implement a "Most Recent Files" list, where the last, say, four files accessed by the application can quickly be re-opened by...
4
by: TommyC | last post by:
Hi all, Kindly need your attention here. Let say, n = 0; // number of corner points detected if (......) { corner_list.x = j; //x coordinate corner_list.y = i; //y coordinate n++;
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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,...

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.