Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Code behind and include file
Message
From
20/05/2003 14:47:11
 
 
To
20/05/2003 12:41:45
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00790138
Message ID:
00790684
Views:
20
Well, I thought I had it figured out. I added a form in my first data cell and then added a panel control to the form. The panel control contained the page I wanted to load. This worked fine. So I tried to a form in each data cell and add a panel that contained my page to the form. Trouble, I forgot you can only have one form tag per page. If I use just one form tag and the controls as I reach the data cell, the table structure does not hold form. Another words, it will show the first page and then under that page it will show the next page and so forth. No structure at all. When I try the placeholder I don't get an error, the table structure is there, but the page just doesn't show. Below is the code for both with the form code listed first. Thanks for the help.
    Inherits Page

    Dim pnlPanel1 As New Panel()
    Dim pnlPanel2 As New Panel()
    Dim pnlPanel3 As New Panel()

Overridable Sub Page_Load()

        Me.PageTitle = "Enhanced Systems Consulting"
        Me.LeftSide = "maintoolbar.ascx"
        Me.LeftSideDimension = " width=190 height=100%"
        Me.Top = "esc.ascx"
        Me.TopDimension = " width=100% height=200"
        Me.Middle = ""
        Me.MiddleDimension = ""

        pnlPanel1.Controls.Add(Page.LoadControl(Me.LeftSide))
        pnlPanel2.Controls.Add(Page.LoadControl(Me.Top))
    End Sub

    Protected Overrides Sub CreateChildControls()

        ' Add Opening HTML Tags
        Dim strOpenHTML As String
        strOpenHTML = _
            "<html>" & _
                "<head>" & _
                    "<title>" & PageTitle & "</title>" & _
                "</head>" & _
                "<body>"
        Controls.Add(New LiteralControl(strOpenHTML))

        ' Add Base Setup HTML Tags
        Dim strBaseHTML As String
        strBaseHTML = _
            "<table ID=""Table1"">" & _
                "<tr>" & _
                    "<td" & Me.LeftSideDimension & ">"
        '****************************
        Controls.Add(New LiteralControl(strBaseHTML))

        ' Add Controls contained within the data cell (Left Side)
        pnlPanel1.ID = "pnlSidePanel"
        frmForm.Controls.Add(pnlPanel1)
        ' End adding controls for the Left Side
        '****************************
        strBaseHTML = _
                        "</td>" & _
                            "<td>" & _
                                "<table ID=""Table2"">" & _
                                    "<tr>" & _
                                        "<td" & Me.TopDimension & ">"
        '****************************
        Controls.Add(New LiteralControl(strBaseHTML))

        ' Add Controls contained within the data cell (Top)
        pnlPanel2.ID = "pnlTopPanel"
        frmForm.Controls.Add(pnlPanel2)
        ' End adding controls for the Top
        '****************************
        strBaseHTML = _
                                        "</td>" & _
                                    "</tr>" & _
                                    "<tr>" & _
                                        "<td" & Me.MiddleDimension & ">MIDDLE"
        '****************************
        Controls.Add(New LiteralControl(strBaseHTML))

        ' Add Controls contained within the data cell (Middle)
        pnlPanel3.ID = "pnlMiddlePanel"
        frmForm.Controls.Add(pnlPanel3)
        ' End adding controls for the Top
        '****************************
        strBaseHTML = _
                                        "</td>" & _
                                    "</tr>" & _
                                "</table>" & _
                            "</td>" & _
                        "</tr>" & _
                    "</table>"
        Controls.Add(New LiteralControl(strBaseHTML))

        ' Add Closing HTML Tags
        Dim strCloseHTML As String
        strCloseHTML = _
                "</body>" & _
        "</html>"
        Controls.Add(New LiteralControl(strCloseHTML))

    End Sub
Place Holder Code
    Inherits Page

    Dim PagePlaceHolder As New PlaceHolder()

    Overridable Sub Page_Load()

        Me.PageTitle = "Enhanced Systems Consulting"
        Me.LeftSide = "maintoolbar.ascx"
        Me.LeftSideDimension = " width=190 height=100%"
        Me.Top = "esc.ascx"
        Me.TopDimension = " width=100% height=200"
        Me.Middle = ""
        Me.MiddleDimension = ""

        PagePlaceHolder.Controls.Add(Page.LoadControl(Me.LeftSide))
    End Sub

    Protected Overrides Sub CreateChildControls()

        ' Add Opening HTML Tags
        Dim strOpenHTML As String
        strOpenHTML = _
            "<html>" & _
                "<head>" & _
                    "<title>" & PageTitle & "</title>" & _
                "</head>" & _
                "<body>"
        Controls.Add(New LiteralControl(strOpenHTML))

        ' Add Base Setup HTML Tags
        Dim strBaseHTML As String
        strBaseHTML = _
            "<table ID=""Table1"">" & _
                "<tr>" & _
                    "<td" & Me.LeftSideDimension & ">" & _
                        "<asp:PlaceHolder id=""PagePlaceHolder"" runat=""server"" />"

        '****************************
        Controls.Add(New LiteralControl(strBaseHTML))
        '****************************
        strBaseHTML = _
                        "</td>" & _
                            "<td>" & _
                                "<table ID=""Table2"">" & _
                                    "<tr>" & _
                                        "<td" & Me.TopDimension & ">TOP"
        '****************************
        Controls.Add(New LiteralControl(strBaseHTML))
        '****************************
        strBaseHTML = _
                                        "</td>" & _
                                    "</tr>" & _
                                    "<tr>" & _
                                        "<td" & Me.MiddleDimension & ">MIDDLE"
        '****************************
        Controls.Add(New LiteralControl(strBaseHTML))
        '****************************
        strBaseHTML = _
                                        "</td>" & _
                                    "</tr>" & _
                                "</table>" & _
                            "</td>" & _
                        "</tr>" & _
                    "</table>"
        Controls.Add(New LiteralControl(strBaseHTML))

        ' Add Closing HTML Tags
        Dim strCloseHTML As String
        strCloseHTML = _
                "</body>" & _
        "</html>"
        Controls.Add(New LiteralControl(strCloseHTML))

    End Sub
Randy Belcher
AFG Industries, Inc.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform