RadhaKrishnaKiJaya
asked on
Previous Page's URL
Environment: Visual Studio 2019, ASP.NET and C#
Hello,
Requirement: I have a page, which can be called from couple of web pages. I need to return to the (Response.Redirect) page from where it was called by clicking a Back button.
Possible soultion: So I am retriving the called page URL by using CalledPageURL = Page.Request.UrlReferrer.ToString(). The value I retrivie is http://localhost:62000/Home.aspx. Now I need to save this value, so that it would not get refreshed (null) during page Post Back (IsPostBack).
I am trying to use Session variable or ViewState options. But both of them are not working. They save the value successfully. But I try to retrive the vallue, I am getting null exception. Please let me know how to fix it.
Thank you in advance.
Hello,
Requirement: I have a page, which can be called from couple of web pages. I need to return to the (Response.Redirect) page from where it was called by clicking a Back button.
Possible soultion: So I am retriving the called page URL by using CalledPageURL = Page.Request.UrlReferrer.ToString(). The value I retrivie is http://localhost:62000/Home.aspx. Now I need to save this value, so that it would not get refreshed (null) during page Post Back (IsPostBack).
I am trying to use Session variable or ViewState options. But both of them are not working. They save the value successfully. But I try to retrive the vallue, I am getting null exception. Please let me know how to fix it.
Thank you in advance.
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
If more help needed please post your controller code and your associated view. I do not need all you code just the basics like how you call your page and Index and Post methods