Click here to Skip to main content
15,888,325 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
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????
Posted
Comments
Ed Nutting 9-Sep-12 13:34pm    
What on earth are you on about? Please write this in your native language, then use Google translate (or similar), copy the translated result, then use the Improve Question link above to edit your question and include the translated version - it will make more sense than anything you have written already...

Thanks,
Ed

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:
JavaScript
history.back()
 
Share this answer
 
You can capture the calling page URL and store it in Session or ViewState.

For example with Session, in Page_Load,

C#
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:

C#
Response.Redirect(Session["PreviousPage"].ToString(), false);
//OR
Response.Redirect(Request.ServerVariables("HTTP_REFERER"), false);
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900