Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to grab the parent url from an iFrame using c#

My scenario is I have a page name UserMain.aspx and in this page I have 2 sections (ie2 IFrames). Now from one of the IFrame pages I want to get parentUrl (ie www.xyz/UserMain.aspx). I have tried the Request.url but it's giving the url of IFrame, how to get the parentUrl?

Both IFrame and parent pages are on same domain.

like image 972
FosterZ Avatar asked Sep 06 '10 11:09

FosterZ


1 Answers

You could try using the following. I tried it in one of my solutions but it was not quite what I needed. Maybe it will help you

Request.UrlReferrer.OriginalString.ToString();
like image 179
Joachim Prinsloo Avatar answered Sep 21 '22 11:09

Joachim Prinsloo