Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

iframe request parent page querystring

Posted on 2011-03-10
7
Medium Priority
?
1,822 Views
Last Modified: 2012-06-27
Parent.Page.Request.QueryString("In")

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?

0
Comment
Question by:Seven price
[X]
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
7 Comments
 
LVL 59

Expert Comment

by:HainKurt
ID: 35097709
just use

Request.QueryString("In")

or simply:

Request("In")


0
 
LVL 9

Author Comment

by:Seven price
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.
0
 
LVL 59

Expert Comment

by:HainKurt
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

like

<iframe src='frame.aspx?in=<%=request("in") %>' ...>
0
Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

 
LVL 59

Expert Comment

by:HainKurt
ID: 35097809
or use session...

on page.aspx.vb page_load event

session("in")=request("in")

then use session("in") in frame.aspx.vb
0
 
LVL 9

Author Comment

by:Seven price
ID: 35097819
I tried a session but i thought there was another way on the server side.
0
 
LVL 59

Accepted Solution

by:
HainKurt earned 2000 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...
0
 
LVL 9

Author Closing Comment

by:Seven price
ID: 35098427
ts
0

Featured Post

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

Question has a verified solution.

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

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…
I have a Synology DS212+ NAS.  These are not only great for backup and normal NAS stuff, but also for delivering media throughout your home or LAN via DLNA.  I copied my whole audio collection from iTunes over to the box, but couldn't figure out how…
Viewers will get an overview of how to make and use Drum Racks in Ableton Live. Load new Drum Rack into empty MIDI track: Fill rack with audio samples: Re-arrange sample slots as necessary: Adjust parameters of each slot to tailor each sound a…
Viewers will learn how to use LFOs to modulate the sound of their Sampler instruments. Click the Modulation tab in Sampler: Choose one (or more) of the three available LFOs, and click the respective button to turn it on: Select a waveform, an LF…

721 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