Solved

iframe request parent page querystring

Posted on 2011-03-10
7
1,645 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:sevensnake77
  • 4
  • 3
7 Comments
 
LVL 51

Expert Comment

by:HainKurt
ID: 35097709
just use

Request.QueryString("In")

or simply:

Request("In")


0
 
LVL 9

Author Comment

by:sevensnake77
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 51

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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
LVL 51

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:sevensnake77
ID: 35097819
I tried a session but i thought there was another way on the server side.
0
 
LVL 51

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:sevensnake77
ID: 35098427
ts
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
The advancements in today's technology are unparalleled. Much of the technology that we have could not have been imagined twenty years ago. One of the latest additions to the list of technological advances is virtual reality. Virtual reality has an …
Users will learn how to set proper sequence settings, scale images, paste attributes, add transitions, fades, and music. Open up Final Cut Pro 7 and Create a new Project: Set the Sequence Settings. a) Click File > Easy Setup > Format > Apple ProRe…
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…

776 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