?
Solved

Need to Pass Dynamic src value to Iframe in ASPX Page

Posted on 2013-06-17
1
Medium Priority
?
2,190 Views
Last Modified: 2013-06-18
Hello Folks

I have an ASPX page that loads from a selected hyperlink from another page which contains lists of customers.

CustomerDisplay.aspx?key1=8

It is passed a value (key1) which is retrieved by the Request.Querystring.
This is the DB key needed to run another ASPX page which is contained in an iframe.

<iframe id="ifrm1" runat=server src="CustomerPayments.aspx?key1=8" />

Hardcoding the src URL plus key parameter successfully launches the second ASPX page and lists the display in the iframe.

The problem I'm having is finding a good way to assign the iframe src parameter dynamically so the CustomerDisplay will show payments for any customer.

Does anyone have a easy suggestion?

Thanks

Bob
0
Comment
Question by:Bob_ET
[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
1 Comment
 
LVL 8

Accepted Solution

by:
johny_bravo1 earned 1000 total points
ID: 39254043
This is your iframe
<iframe id="ifrm1" runat=server src="CustomerPayments.aspx?key1=8" />

You can add attributes from code behind like this,
ifrm1.Attributes.Add("src", "CustomerPayments.aspx?key1=8");

Or

ifrm1.Attributes["src"] = String.Format("CustomerPayments.com?key1={0}",Request.QueryString[0].ToString());
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

This article discusses four methods for overlaying images in a container on a web page
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
Google currently has a new report that is in beta and coming soon to Webmaster Tool accounts. This Micro Tutorial will highlight new features for Google Webmaster Tools.

649 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