We help IT Professionals succeed at work.
Get Started

How do I pass a QueryString value to an iFrame?

cdemott33
cdemott33 asked
on
367 Views
Last Modified: 2016-02-10
Hi Team-

I could use some help here.  I have a classic ASP page that uses a iFrame.  The iFrame loads an ASP.NET page on another server.  

When my classic ASP page loads there's a QueryString value I need for my IFrame page to load correctly.

How do I pass a QueryString value to my iFrame so my ASPX page can read the value?

So here an example of my Classic ASP page URL:

http://www.myclassicasp.com/myform.asp?intakeID=12345678

Here's my iframe in my Classic ASP page:

<iframe id="myIframe" src="http://myaspxapplication.com/IntakeUpload.aspx" width="100%" frameborder="0">
</iframe>

Open in new window


Here's my code behind on my IntakeUpload.aspx page (The page that's getting loaded into my iFrame)

    Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load

        Dim intIntakeID As Nullable(Of Integer) = CInt(Request.QueryString("intakeID"))

        If intIntakeID.HasValue Then
            lbIntakeID.Text = "No Intake ID found"
        Else
            lbIntakeID.Text = intIntakeID.ToString
        End If

    End Sub

Open in new window

Comment
Watch Question
Web Ninja at large
CERTIFIED EXPERT
Commented:
This problem has been solved!
Unlock 1 Answer and 3 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE