iframe request parent page querystring

Posted on 2011-03-10
Last Modified: 2012-06-27

Hello, I tried the above to retrieve the parent page querystring but I get an error.
 System.NullReferenceException: Object reference not set to an instance of an object.

in vb how can I retrieve the querystring value to pass to my parameter?

Question by:sevensnake77
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
LVL 53

Expert Comment

by:Huseyin KAHRAMAN
ID: 35097709
just use


or simply:



Author Comment

ID: 35097728
You did not read the entire question i suppose,
The page is in a iframe but I need the query string from the parent page the iframe lives.
LVL 53

Expert Comment

by:Huseyin KAHRAMAN
ID: 35097801
do you mean this?

page.aspx has an iframe inside, say name=myFrame, src=frame.aspx

you call page.aspx?in=HK and somehow you post the myFrame and in the code frame.aspx.vb you want to get the in parameter of page.aspx?

if this is the case, you should create a hidden variable in frame.aspx and set it to "in" param before submitting it on client side, either with js or when you construct the src attribute of frame


<iframe src='frame.aspx?in=<%=request("in") %>' ...>
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

LVL 53

Expert Comment

by:Huseyin KAHRAMAN
ID: 35097809
or use session...

on page.aspx.vb page_load event


then use session("in") in frame.aspx.vb

Author Comment

ID: 35097819
I tried a session but i thought there was another way on the server side.
LVL 53

Accepted Solution

Huseyin KAHRAMAN earned 500 total points
ID: 35098095
on the server you cannot get the parent page of browser :)

somehow you should pass that parameter to the server when iframe src is requested (either adding id to url or setting a cookie or setting a hidden variable and post it) or use session...

in your case simplest way is set a session whenever you have that param and use it later when you need...

Author Closing Comment

ID: 35098427

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
orderby list (from Json) 1 44
Telerik RadEditor Control Save 8 40
video production software 3 55
How does this modal gets closed? 6 42
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Tired of waiting for your show or movie to load?  Are buffering issues a constant problem with your internet connection?  Check this article out to see if these simple adjustments are the solution for you.
This video will demonstrate how to customize windows, tools, and control bars, and save them as screen sets. Open and resize windows: Customize the toolbar: Customize the control bar: Customize your tool selections: Your screen set is alread…
Viewers will learn how to create and use Simpler instruments in Ableton Live. Load new Simpler into an empty MIDI track: Select a sample and drop it into sample window in Simpler: If sample is not pitched at C3, adjust tuning with Transpose para…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question