我要查找PrePage用户 [英] I want to Find PrePage User

查看:66
本文介绍了我要查找PrePage用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好
我想在其中查找用户要使用的PrePage !!!!
例如,用户存在于Page1.aspx中,然后单击一个按钮并重定向到Page2.aspx
在Page2.aspx中,我有一个LinkBut​​ton.onCommand,我希望重定向PrePage(Page1.aspx)
解决方案

我建​​议你2种方法:
1-您可以使用包含有名为prepage的变量的查询字符串,该变量显示您的用户访问页面之前已经是

2-您可以使用javascript!最好在js中使用此方法:

 历史记录 .back()


您可以捕获调用页面的网址和将其存储在Session或ViewState中.

例如,使用Session,在Page_Load中,

会话[" ] = Request.Url.ToString() ;
//  OR 
会话[" ] = Request.ServerVariables("  HTTP_REFERER"); 


然后在您的最终事件中(也许是Savebutton_Click或CloseButton_Click),您可以通过以下两种方式之一进行重定向:

 Response.Redirect(Session [" ].ToString() , false );
//  OR 
Response.Redirect(Request.ServerVariables(" ), false ); 


hi all
i want to Find PrePage that User it in!!!!
for Example User exist in Page1.aspx and Click A Button And Redirect To Page2.aspx
in Page2.aspx i have A LinkButton.onCommand Of LinkButton i Want Redirect PrePage(Page1.aspx)
how????

解决方案

i suggest you 2 ways:
1- you can use querystring that include a variable named prepage that it shows you wich page user have been beforee

2-you can use javascript ! well use this method in js:

history.back()


You can capture the calling page URL and store it in Session or ViewState.

For example with Session, in Page_Load,

Session["PreviousPage"] = Request.Url.ToString();
//OR
Session["PreviousPage"] = Request.ServerVariables("HTTP_REFERER");


And then in your final event (perhaps Savebutton_Click or CloseButton_Click), you can do a redirect in either of these ways:

Response.Redirect(Session["PreviousPage"].ToString(), false);
//OR
Response.Redirect(Request.ServerVariables("HTTP_REFERER"), false);


这篇关于我要查找PrePage用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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