change IFRAME src

N

Nikolay Petrov

I have an aspx page with an IFRAME in it.
I change the contents of this IFRAME from a NAV menu.
What I need is, to load the master aspx page and load a page in the
IFRAME from a link in another page.
Any ideas? Thanks.
 
A

AMDRIT

If I understand you correctly, when a user clicks a link (i.e. a navigation
link) you would like to change the source of the IFrame. Let's start
simple:

using javascipt create a function

LoadIT(newurl)
{
//logic to navigate to new url
}

for each menu item, wire a client side event handler that calls LoadIT

in asp, you would do <a href="javascript:LoadIT(""Mynewurl.html"")">Click
Me</a>

so perhaps you could specify javascript:LoadIT(""Mynewurl.html"") in the
sitemap file you use for your navigation menu.
 
K

KJ

I'm not sure if this is what you're after, but you can add the
runat=server attribute to the iframe (and., of course, the id
attribute), then access the src property of that iframe (in server-side
code) through the attributes collection of the control.
 
N

Nikolay Petrov

thanks AMDRIT, but not exactly
let me say it that way
We have aspx page A, which contatians IFRAME. This iframe has it's src
set to point page C.
Also we have page B, which has a link to page A. I want from page B to
load page A, but also change the src of the IFRAME from page C, to
other page D.
hope's that clears it out
 
A

AMDRIT

No, Nikolay, it is not clear what you are accomplishing.


Are you trying to dynamically append the content of page A on to page B?

Example:

Page B

<body>
here is some content, already on page B
</body>

Page A

<body>
here is some content, already on page A
</body>

Result after menu click

Page B

<body>
here is some content, already on page B
<br>
here is some content, already on page A
</body>
 
C

Cor Ligthert [MVP]

Nikolay,

We use an Iframe on website inside ASPX net 1.x
..
http://www.vb-tips.com/default.aspx

The IFrame
<iframe id="midFrame" name="midFrame" runat="server"></iframe>

To fill the Iframe
midFrame.Attributes("src") = FramPage.aspx

For exchange information between the pages we use information in a session.

I hope this gives some ideas

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,525
Members
44,997
Latest member
mileyka

Latest Threads

Top