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. Advertising

  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. Advertising

  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. Advertising

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. Harry
    Replies:
    3
    Views:
    562
    Harry Singh
    Nov 10, 2003
  2. HS1
    Replies:
    3
    Views:
    499
  3. HS1
    Replies:
    4
    Views:
    8,325
    Babu Kalakrishnan
    Dec 8, 2004
  4. JC
    Replies:
    1
    Views:
    759
    Michael Rauscher
    Aug 9, 2006
  5. Ulf Meinhardt
    Replies:
    0
    Views:
    633
    Ulf Meinhardt
    Jul 7, 2009
Loading...

Share This Page