iframe request parent page querystring

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?

LVL 9
Seven priceFull StackAsked:
Who is Participating?
 
HainKurtConnect With a Mentor Sr. System AnalystCommented:
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
 
HainKurtSr. System AnalystCommented:
just use

Request.QueryString("In")

or simply:

Request("In")


0
 
Seven priceFull StackAuthor Commented:
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
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
HainKurtSr. System AnalystCommented:
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
 
HainKurtSr. System AnalystCommented:
or use session...

on page.aspx.vb page_load event

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

then use session("in") in frame.aspx.vb
0
 
Seven priceFull StackAuthor Commented:
I tried a session but i thought there was another way on the server side.
0
 
Seven priceFull StackAuthor Commented:
ts
0
All Courses

From novice to tech pro — start learning today.