最令人难以置信的现象 [英] most unbelievable phenomenon

查看:88
本文介绍了最令人难以置信的现象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这就是发生的事情。

On''page1.aspx''我重定向到''page2.aspx'':

Response.Redirect(" ; page2.aspx",true);


On''page2.aspx''我正在重定向到''page3.aspx'':

Response.Redirect(" page3.aspx",true);


当页面'page3.aspx''''Page_Load''完成时

也称为''Page_Load''页面''page1.aspx''。(bizzare)

请理解我绝不会打电话给它。


发生什么事了?!!!!!!!


我在使用各种形式的断点进行调试时找到了所有这些'''Page_Load''

事件。

顺便说一下,''page2.aspx''从不调用''page1.aspx'',只调用''page3.aspx''。


任何见解?

谢谢,

Oleg

解决方案

重定向和停止执行是2 dif有些事情。也就是说,

Response.Redirect向客户端发送HTTP重定向消息。它并没有b $ b说停止执行程序。第1页的代码没有从

调用任何东西。它只是在继续。


-

HTH,


Kevin Spencer

Microsoft MVP

..Net开发人员

你可以把鱼带到自行车上,

但是你不能做到很臭。


" Oleg" < 01 ** @ discussions.microsoft.com>在消息中写道

新闻:A4 ********************************** @ microsof t.com ...

这就是发生的事情。
在''page1.aspx''我重定向到''page2.aspx'':
响应。重定向(" page2.aspx",true);

在''page2.aspx''我正在重定向到''page3.aspx'':
Response.Redirect( " page3.aspx",true);

当页面'page3.aspx''''Page_Load''完成它时
也调用''Page_Load''页面''page1 .aspx''。(bizzare)
请理解我绝不会打电话给它。

发生什么事了?!!!!!!!
我在调试所有形式的'
''Page_Load''
事件时发现了所有这些。
顺便说一下,''page2.aspx''从不调用''page1 .aspx'',只有''page3.aspx''。

任何见解?
谢谢,
Oleg



胡h?

重定向没有得到'执行后,我感觉不到,ASP.NET

中止。

也喜欢使用Response时.end

必须再次验证。

" Kevin Spencer" <柯*** @ DIESPAMMERSDIEtakempis.com> schreef in bericht

news:uG *************** @ tk2msftngp13.phx.gbl ...

重定向并停止执行是两件不同的事情。也就是说,Response.Redirect向客户端发送HTTP重定向消息。它没有说在这里停止程序执行。
任何东西都没有调用代码。它只是在继续。

-
HTH,

Kevin Spencer
微软MVP
.Net开发人员
你可以把鱼带到自行车上,但是你不能让它发臭。

Oleg < 01 ** @ discussions.microsoft.com>在消息中写道
新闻:A4 ********************************** @ microsof t.com。 ..

这就是发生的事情。
在''page1.aspx''我重定向到''page2.aspx'':
Response.Redirect(") page2.aspx",true);

在''page2.aspx''我正在重定向到''page3.aspx'':
Response.Redirect(" page3。 aspx",true);

当页面'page3.aspx''''Page_Load''完成它时
也会调用'page_Load''页面''page1.aspx'' (bizzare)
请理解,我决不会打电话给它。

发生什么事了?!!!!!!!

我找到了全部在调试所有形式的'_
''Page_Load''
事件时使用断点。
顺便说一句,''page2.aspx''从不调用''page1.aspx'' ,只有''page3.aspx''。

任何见解?
谢谢,
Oleg




我的错,埃德温。在正常情况下,它会终止执行。我是在考虑EndResponse的时候。参数。但是,经过进一步的研究,我发现如果在Http

标题被发送到客户端后调用它会引发HttpException。我不确定这是否可能导致方法被中断而不是调用Response.End。如果是这样,那可能是问题的原因。

-

HTH,


Kevin Spencer

Microsoft MVP

..Net开发人员

您可以将鱼带到自行车上,
但你不能让它发臭。


Edwin Knoppert <在** @ pbsoft.speedlinq.nl>在消息中写道

新闻:dn ********** @ azure.qinip.net ...

嗯?
我在重定向之后的印象没有得到执行,ASP.NET
中止。
也喜欢使用Response.end
将需要再次验证。

凯文斯宾塞 <柯*** @ DIESPAMMERSDIEtakempis.com> schreef in bericht
新闻:uG *************** @ tk2msftngp13.phx.gbl ...

重定向和停止执行是两回事。也就是说,Response.Redirect向客户端发送HTTP重定向消息。它没有说在这里停止程序执行。第1页的代码不会被任何东西调用。它只是在继续。

-
HTH,

Kevin Spencer
微软MVP
.Net开发人员
你可以把鱼带到自行车上,但是你不能让它发臭。

Oleg < 01 ** @ discussions.microsoft.com>在消息中写道
新闻:A4 ********************************** @ microsof t.com。 ..

这就是发生的事情。
在''page1.aspx''我重定向到''page2.aspx'':
Response.Redirect(") page2.aspx",true);

在''page2.aspx''我正在重定向到''page3.aspx'':
Response.Redirect(" page3。 aspx",true);

当页面'page3.aspx''''Page_Load''完成它时
也会调用'page_Load''页面''page1.aspx'' (bizzare)
请理解,我决不会打电话给它。

发生什么事了?!!!!!!!

我找到了全部在调试所有形式的'_
''Page_Load''
事件时使用断点。
顺便说一句,''page2.aspx''从不调用''page1.aspx'' ,只有''page3.aspx''。

任何见解?
谢谢,
Oleg





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

解决方案

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



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




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





这篇关于最令人难以置信的现象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆