Solved

iframe request parent page querystring

Posted on 2011-03-10
7
1,760 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 56

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 56

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
Get MySQL database support online, now!

At Percona’s web store you can order your MySQL database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card.

 
LVL 56

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 56

Accepted Solution

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

Author Closing Comment

by:Seven price
ID: 35098427
ts
0

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Many programs have tried to outwit PowerPoint in terms of technology and skill. These programs, however, still lack several characteristics that PowerPoint has possessed from the start. Here's why PowerPoint replacements won't entirely work for desi…
Viewers will learn how to turn a Live Set into a compressed Live Pack file, and how to install Live Packs. Make: File > Collect All And Save: File > Manage Files: Click Manage Project: Click Create Pack: Select save location: Install: Doub…
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…

617 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