Redirect和Transfer的传值

在一个页面中跳转使用Redirect跳转,要想获取跳转前的cookie,请修改为Transfer方法。

如:

string url = TemplateSourceDirectory + "/Default.aspx?userGroupID=" + userGroupID + "&endUrl=" + endurl;

Response.Redirect(url);

修改为:
Server.Transfer(url);

 

在跳转成功后,这样就能获取跳转前的cookie或session的值。

posted on 2012-05-07 21:25  antyi  阅读(161)  评论(0编辑  收藏  举报

导航