Zeba wrote:
How do I get the URL of the page which has called the current page.
Say PageA.aspx calls PageB.aspx. How do I get PageA's url from the
Pre_Init function of PageB. I tried something like
Request.UrlReferrer.ToString()
But it gives me an Object not instantiated error.
Hi,
The simple test shows that the task with the conditions you discribed
(PageA.aspx calls PageB.aspx) always returns Request.UrlReferrer!=null
and it cannot generate the "Object not instantiated" error.
So I guess the problem is in something you did not mention.
There are 2 cases when it can happens:
1. You calls PageB.aspx by the means of javascript
:
<a href="javascript
:window.open('PageB.aspx');void(0) ;"...
In this case try to change link:
<a href="PageB.aspx" target="_blank" ...
2. PageA.aspx is a secure page. (
https://...../PageA.aspx). Honestly,
I am not sure you can get information about PageA.aspx anyway.