display an aspx page on a panel

W

William LaMartin

Is there a way to place an aspx page on a panel contained on another aspx
page? I can display an HTML page on the panel using a literal can figure no
way to put and aspx page there.
 
B

Brian Watkins

Place an Iframe on the panel and set its source to your aspx page.

<div id="panel1" class="panel" >
<iframe name="iframe" src="your.aspx" class="iframe"> </iframe>
</div>
 
W

William LaMartin

I have an aspx page I have already built using several ascx user controls.
I would like to display that page in a panel on another page.

The reason I did not add the user controls via code to the panel is that
when I try code like

Me.Panel1.Visible = True
Me.Panel1.Controls.Clear()
Dim MyHeader As New System.Web.UI.UserControl
MyHeader.LoadControl("header.ascx")
Me.Panel1.Controls.Add(MyHeader)

I get the error: The virtual path '/header.ascx' maps to another
application, which is not allowed. And I can find no way to get away from
the error message.

However, on a second look, I discovered that code like

Dim uc1 As Control = Page.LoadControl("header.ascx")
Me.Panel1.Controls.Add(uc1)

does not produce the error. so I can use the method you suggest. But now I
am curious as to why the first block of code produces the error and the
second doesn't.
 
W

William LaMartin

Is there a way to add the iframe in code only? Something like

Dim MyIframe As New HtmlGenericControl
MyIframe.Attributes("SRC") = "Join.aspx"
Me.Panel1.Controls.Add(MyIframe)

which doesn nothing.
 

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,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top