Tacking previous page url
-
Wednesday, June 27, 2012 10:39 AM
Dear all,
how to the information about the previous page url,
i am trying to do it by using request.urlreferrer,but i am unable to track the requests from https,
any please guide me to over come this problem
Thanks in Advance...
- Moved by Bob ShenMicrosoft Contingent Staff Friday, July 06, 2012 9:00 AM (From:Visual C# General)
All Replies
-
Wednesday, June 27, 2012 10:47 AM
Hi,
I don't think it is possible for browser passing https url as UrlReferrer to http. It will be null always when you navigate from https to http.
This question is more related to http://forums.asp.net/.
If this post answers your question, please click "Mark As Answer". If this post is helpful please click "Mark as Helpful".
- Edited by Kris444 Wednesday, June 27, 2012 10:47 AM
-
Wednesday, June 27, 2012 12:41 PM
try this
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) //check if the webpage is loaded for the first time. { ViewState["PreviousPage"] = Request.UrlReferrer;//Saves the Previous page url in ViewState } } protected void btnBack_Click(object sender, EventArgs e) { if (ViewState["PreviousPage"] != null) //Check if the ViewState //contains Previous page URL { Response.Redirect(ViewState["PreviousPage"].ToString());//Redirect to //Previous page by retrieving the PreviousPage Url from ViewState. } }
good luck
click "Proposed As Answer" if this post solves your problem or "Vote As Helpful" if a post has been useful to you
- Edited by Pooyan Fekrati Wednesday, June 27, 2012 12:42 PM
-
Friday, July 06, 2012 9:00 AM
Hi deep,
You are more likely to get more efficient responses to ASP.NET issues at http://forums.asp.net where you can contact ASP.NET experts.
Bob Shen [MSFT]
MSDN Community Support | Feedback to us

