文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>Response.Redirect和Server.Transfer面对页面刷新时的小区别

Response.Redirect和Server.Transfer面对页面刷新时的小区别

时间:2011-03-03  来源:李传涛

Server Transfer

  1. Client Request Page HelloWorld.ASPX
  2. Server.Transfer -> Server send a different page to the client
  3. Client Receives Page still thinking it's HelloWorld.ASPX.
  4. Client's URL (Address bar) remains HelloWorld.ASPX since the page was sent on the server side and the client doesn't know a different page was sent.

Response.Redirect

  1. Client Requests Page HelloWorld.ASPX
  2.  Response.Redirect -> Server sends a HTTP header informing that the user should redirect.
  3.  Client sees the redirect notice and requests AnotherPage.ASPX
  4.  Server sends AnotherPage.ASPX
  5. Client's URL (address bar) shows AnotherPage.ASPX

Server Transfer使用特殊注意事项:

  假如从A页面Transfer到B页面之后,在B页面刷新的话,此时会重新回到A页面的后台,进入A页面的点击事件然后再transfer到B页面。

如果A页面的点击事件有对数据库操作的话,此时就会再次操作数据库。为了数据安全还是Response.Redirect比较好。

相关阅读 更多 +
排行榜 更多 +
瓢虫少女

瓢虫少女

飞行射击 下载
潜艇鱼雷

潜艇鱼雷

飞行射击 下载
网络掠夺者

网络掠夺者

飞行射击 下载