display an aspx page on a panel

Discussion in 'ASP .Net' started by William LaMartin, Dec 10, 2003.

  1. 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.
     
    William LaMartin, Dec 10, 2003
    #1
    1. Advertisements

  2. Why not use ascx user controls to build your composite page?

    --
    Chris Jackson
    Software Engineer
    Microsoft MVP - Windows Client
    Windows XP Associate Expert
    --
    More people read the newsgroups than read my email.
    Reply to the newsgroup for a faster response.
    (Control-G using Outlook Express)
    --

    "William LaMartin" <> wrote in message
    news:...
    > 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.
    >
    >
     
    Chris Jackson, Dec 10, 2003
    #2
    1. Advertisements

  3. 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>
     
    Brian Watkins, Dec 10, 2003
    #3
  4. 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.


    "Chris Jackson" <chrisjATmvpsDOTorgNOSPAM> wrote in message
    news:...
    > Why not use ascx user controls to build your composite page?
    >
    > --
    > Chris Jackson
    > Software Engineer
    > Microsoft MVP - Windows Client
    > Windows XP Associate Expert
    > --
    > More people read the newsgroups than read my email.
    > Reply to the newsgroup for a faster response.
    > (Control-G using Outlook Express)
    > --
    >
    > "William LaMartin" <> wrote in message
    > news:...
    > > 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.
    > >
    > >

    >
    >
     
    William LaMartin, Dec 10, 2003
    #4
  5. 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.


    "Brian Watkins" <> wrote in message
    news:%...
    > 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>
    >
    >
     
    William LaMartin, Dec 10, 2003
    #5
    1. Advertisements

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sriram Mallajyosula

    How do I post data from aspx page to another aspx page.

    Sriram Mallajyosula, Nov 5, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    1,245
    Steve C. Orr [MVP, MCSD]
    Nov 5, 2003
  2. Marco Antonio Montalvo Durán
    Replies:
    2
    Views:
    4,546
    Matt Morris
    Jan 23, 2004
  3. =?Utf-8?B?Uk1M?=
    Replies:
    1
    Views:
    710
    =?Utf-8?B?QW5keSBMdWtzaWM=?=
    Sep 16, 2005
  4. Progman
    Replies:
    2
    Views:
    2,128
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Feb 13, 2006
  5. uto
    Replies:
    3
    Views:
    811
    Michael Hamrah
    Mar 8, 2006
  6. MadHatter51
    Replies:
    1
    Views:
    1,105
    Hakan Lambracht
    May 17, 2006
  7. S_K
    Replies:
    1
    Views:
    515
    IfThenElse
    Oct 2, 2007
  8. S_K
    Replies:
    0
    Views:
    476
Loading...