G
Grzesiek
Hi!
I have created page which contains some menu buttons and <iframe> with
sub-page. Each menu action on the master web site should change content of
iframe (by changing src attribute). But how to detect when user has opened
subpage not in master's <iframe> ? Is it possible to obtain reference to
master's page from sub-page ? When I'm trying to do this using Page.Parent I
get null exception
Here's a piece of code
//master.aspx
<%@ Page language="c#" Codebehind="master.aspx.cs" ... %>
....
<form id="Form1" runat="server" method="post">
<iframe id="myIFrame" runat="server" src="subpage.aspx"></iframe>
<asp:Button id="btnStart" runat="server" Text="Button">
</form>
....
//master.aspx.cs
....
private void btnStart_Click(object sender, System.EventArgs e)
{
myIFrame.Attribures["src"] = some_url_address;
}
....
Thx,
Grzesiek
I have created page which contains some menu buttons and <iframe> with
sub-page. Each menu action on the master web site should change content of
iframe (by changing src attribute). But how to detect when user has opened
subpage not in master's <iframe> ? Is it possible to obtain reference to
master's page from sub-page ? When I'm trying to do this using Page.Parent I
get null exception
Here's a piece of code
//master.aspx
<%@ Page language="c#" Codebehind="master.aspx.cs" ... %>
....
<form id="Form1" runat="server" method="post">
<iframe id="myIFrame" runat="server" src="subpage.aspx"></iframe>
<asp:Button id="btnStart" runat="server" Text="Button">
</form>
....
//master.aspx.cs
....
private void btnStart_Click(object sender, System.EventArgs e)
{
myIFrame.Attribures["src"] = some_url_address;
}
....
Thx,
Grzesiek