change IFRAME src

  • Thread starter Thread starter Nikolay Petrov
  • Start date Start date
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.
 
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.
 
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.
 
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
 
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>
 
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
 
Back
Top