?
Solved

Need to Pass Dynamic src value to Iframe in ASPX Page

Posted on 2013-06-17
1
Medium Priority
?
2,159 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
Find out what you should include to make the best professional email signature for your organization.
How to create a custom search shortcut to site-search Experts Exchange using Google in the Firefox browser. This eliminates the need to type out site:experts-exchange.com whenever you want to search the site. Launch your Bookmark Menu: Press 'Ctrl +…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

764 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