Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7577993
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T17:19:30+00:00 2026-05-30T17:19:30+00:00

I have a website which is code generating practically everything on the page. The

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T17:19:31+00:00Added an answer on May 30, 2026 at 5:19 pm

    There are alternatives, certainly, but deciding which one to use depends a lot on exactly what you’re trying to accomplish, and what version of .NET you’re using.

    The Panel control does, in fact, output divs to the page, though if your only requirement is “I want to output divs”, I don’t know that I’d recommend it – I stick with Panels for when I need to control, using ASP.NET, things like visibility for the controls it contains. However, for an existing site, it probably is the closest “drop in” replacement for the TableCell control.

    The Literal control exists in most versions of .NET, and lets you have full control over what gets output to the screen, but, like the Panel control, it’s not a data-bound control; you’d need to get your information in the codebehind, use it to add whatever you like to the .Text of your literal. The downside of this is that dumping exactly the HTML we want to the page from codebehind kind of goes against the ASP.NET way.

    The ListView control is actually a databound control – you give it a database connection of some type, and it will loop over the results and display a list. You have reasonably full control over the HTML that’s output in that list, so you could use divs, lis, etc, but it will be trickier (though nowhere near impossible) to use logic in determining what to display. (There is an earlier, related control, the Repeater, that’s more kludgy to use, but exists in earlier versions of .NET)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have website on the server, which is not precompiled (with source code, so
I have such situation: We have a website which code is not hosted on
I have some piece of code in my Website which adds the details into
I have a website which is composed of Master page and a ascx that
I have built a website which uses ajax for most of the sites functions
I got source code of website which have included master pages but master pages
I have a website on which I dynamically create Javascript code using ASP.NET handler
I have a website to which i've added dynamic javascript code generated on server.
I have some website which requires a logon and shows sensitive information. The person
I have a website which uses the custom 404 error handling in PHP/Apache to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.