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 8969127
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T17:32:58+00:00 2026-06-15T17:32:58+00:00

Here is my ascx control page code <%@ Control Language=C# AutoEventWireup=true CodeBehind=Menu.ascx.cs Inherits=CrossQueue.Web.Menu %>

  • 0

Here is my ascx control page code

    <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Menu.ascx.cs" Inherits="CrossQueue.Web.Menu" %>
<asp:Label ID="lblMenu" runat="server"></asp:Label>

Here is my c# code

private void CreateMenu()
    {
        StringBuilder menuHtml = new StringBuilder();   
        int profileId = 0;
        MenuBL menuManager = new MenuBL();
        DataTable dtMenu = null;
        if (Session["USR_ID"] != null)
        {
            profileId = Convert.ToInt32(Session["USR_PROFILE"]);
            dtMenu = menuManager.GetAllMenuItemsForProfile(profileId);
            if (dtMenu != null && dtMenu.Rows.Count > 0)
            {
                menuHtml.Append("<table id='tblMenu' cellpadding='0' cellspacing='0' width='939' border='0' align='center'>");
                menuHtml.Append("<tr>");
                menuHtml.Append("<td align='left'>");
                menuHtml.Append(Convert.ToString(Session["USR_USERNAME"]));
                menuHtml.Append("</td>");

                menuHtml.Append("<td width='739' valign='middle' align='right' style='height: 30px;'>");
                foreach (DataRow dr in dtMenu.Rows)
                {
                    if (dr["MenuName"].ToString() == "Profile")
                    {
                        menuHtml.Append("<img src='/images/home_icon.jpg' width='25' height='25' align='middle' /><a href='AllProfile.aspx>Profile</a>&nbsp;");
                    }
                    else if (dr["MenuName"].ToString() == "User")
                    {
                        menuHtml.Append("<img src='/images/home_icon.jpg' width='25' height='25' align='middle' /><a href='AllUsers.aspx>User</a>&nbsp;");
                    }
                }
                menuHtml.Append("</td>");
                menuHtml.Append("</tr>");
                menuHtml.Append("</table>");
            }
            lblMenu.Text = menuHtml.ToString();
        }
    }

When i load the page i only see a html code printed as text and not rendering.Can any one point out what may be wrong

  • 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-06-15T17:32:59+00:00Added an answer on June 15, 2026 at 5:32 pm

    You could use a literal instead of a label.

    See this
    http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.literal.aspx

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

Sidebar

Related Questions

I have an ascx control; <%@ Control Language=C# AutoEventWireup=true CodeBehind=LanguageSelect.ascx.cs Inherits=MyNamespace.LanguageSelect %> with code
EDIT: Here is the edited control file (control.ascx): <%@ Control Language=C# AutoEventWireup=true CodeFile=Sale.ascx.cs Inherits=Enmasse.Modules.Demo_Enmasse.Sale
I created ASP.NET user control with javascript function : <%@ Control Language=C# AutoEventWireup=true CodeBehind=TestControl.ascx.cs
If I have a UserControl like this: <%@ Control Language=C# AutoEventWireup=true CodeBehind=Foo.ascx.cs Inherits=Foo %>
I have a simple user control with this code: <%@ Control Language="C#" AutoEventWireup="true" CodeFile="Pager.ascx.cs"
I have an ASP.NET ascx control. In the code behind file I need to
Ok, please understand the architecture here first. OurMasterPage.aspx has user control Header.ascx Header.ascx has
I'm using ASP.NET MVC- I've got a DropDownList rendered in a user control (ascx
In default.aspx page, there is a user control side_menu.ascx. This is part of the
I have an ASP.NET MVC page that has left Menu Navigation that is built

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.