I have a website which is code generating practically everything on the page. The home page consists of a right menu which is being built via code. It uses System.Web.UI.WebControls.TableCell class and creates a td for every new item.
Here is a snippet of the code:
Public Sub BuildMainMenuStructure(ByVal Cell As TableCell, _
ByVal Contents As DataTable, _
ByVal ReadMode As Boolean, _
ByVal CurrentPage As String, _
ByVal RecSecurity As ApplicationRoleSecurity, _
ByVal SourcePageRef As Integer, _
ByVal IncludeMyIntranetPanel As Boolean)
'-----------------------------------------------------------------
'Div1 Contents
'-----------------------------------------------------------------
'Set up the contents in a div (panel) called pnlMainMenu1
Dim mmContents As New MainMenuContents
mmContents.ID = "pcaMainMenuContents"
mmContents.SetControl(Contents, _
ReadMode, _
CurrentPage, _
RecSecurity, _
SourcePageRef)
mintContentsCount = mmContents.Count
Dim pnlMainMenu1 As New Panel
With pnlMainMenu1
.ID = "pcaMainMenuContentsPanel"
'By default, this panel is visible:
.Style.Add("visibility", "visible")
.Controls.Add(mmContents)
End With
In another area in the code a different section of the homepage is generated:
If IncludeMyIntranetPanel And ReadMode Then
'Set up the contents in a div (panel) called pnlMainMenu2
Dim mmMyIntranet As New MainMenuMyIntranet
mmMyIntranet.ID = "pcaMainMenuMyIntranet"
mmMyIntranet.SetControl(Contents, _
ReadMode, _
CurrentPage, _
RecSecurity, _
SourcePageRef)
Dim pnlMainMenu2 As New Panel
With pnlMainMenu2
.ID = "pcaMainMenuMyIntranetPanel"
'By default, this panel is visible:
.Style.Add("visibility", "visible")
.Controls.Add(mmMyIntranet)
End With
'Add it to the cell:
Cell.Controls.Add(pnlMainMenu2)
End If 'End If IncludeMyIntranetPanel
Its adding the content via Cell.Controls.Add(pnlMainMenu2)
I am tasked with trying to re-skin the home page. Ideally I want to generate DIV classes so I can easily position the content.
Is there a .net class that I can use that grabs data from the database and creates div classes?