简体   繁体   English

server.transfer在另一个网页中

[英]server.transfer in another web page

当我们使用Server.Transfer并想在另一个页面上执行某些任务时,由于某种原因,任务失败,例如在这种情况下用户ID被阻止,将会发生什么情况?

It's always advisable to use the Server.Transfer when moving from one page to another in asp.net. 在asp.net中从一页移动到另一页时,始终建议使用Server.Transfer。 If you use the Transfer method which make sure that all the object stored in the session and application scope are remain unchanged. 如果使用Transfer方法,请确保会话和应用程序范围中存储的所有对象均保持不变。

But if you are using asp.net ajax enabled page then Server.Transfer doesn't serve it purpose. 但是,如果您使用的是启用了asp.net ajax的页面,则Server.Transfer不能达到目的。 You need to use the Response.Redirect instead of Server.Transfer in the asp.net ajax enabled pages. 您需要在启用了asp.net ajax的页面中使用Response.Redirect而不是Server.Transfer。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM