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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T14:50:43+00:00 2026-06-05T14:50:43+00:00

Hello guys I’m stuck with this weird problem , asp:HyperLink control is not being

  • 0

Hello guys I’m stuck with this weird problem ,asp:HyperLink control is not being rendered inside browser,it does not even exists in the final HTML sent to the browser.

Home.aspx Asp.net Markup

<div class="LoginBox">
    <div id="LoginViewBox" runat="server">
          <asp:HyperLink ID="linkLogout" runat="server" OnClick="LogOut"></asp:HyperLink>
    </div>
</div>

Home.aspx in the browser

<div class="LoginBox">
  <div id="ctl00_HeadHolder_LoginViewBox">&nbsp;Welcome&nbsp;owaisBhai&nbsp;
  </div>
</div>

Home.Aspx.Cs

   protected void Page_Load(object sender, EventArgs e)
    {
       if(!IsPostBack)
       {
           LoginBoxManager.PopulateLoginBox(ref LoginViewBox, ref linkLogout);
       }
    }

LoginBoxManager.cs

    public static class LoginBoxManager
{
    public static void PopulateLoginBox(ref HtmlGenericControl loginViewBox, ref HyperLink linkLogout)
    {
        string LogInUrl = "Login.aspx";
        string WelcomeGuest = String.Format("&nbsp;Welcome Guest&nbsp;<a href='{0}'>[LogIn]</a>", LogInUrl);
        string WelcomeUser = "";

        if (HttpContext.Current.Session.Count == 0)
        {
            //user not authenticated
            loginViewBox.InnerHtml = WelcomeGuest;
        }
        else
        {
            //user authenticated
            WelcomeUser = 
            String.Format("&nbsp;Welcome&nbsp; {0}&nbsp;"
                                ,SmartSession<User>.LiveSession.UserName);
            loginViewBox.InnerHtml = WelcomeUser;
            linkLogout.Text = "[LogOut]";
        }
    }
}

P.S: I think I have well explained the situation let me know of any details.

  • 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-05T14:50:44+00:00Added an answer on June 5, 2026 at 2:50 pm

    Your code is replacing the asp:HyperLink with text. The problem line is this line:

    loginViewBox.InnerHtml = WelcomeGuest;
    

    By setting the InnerHtml property, you are replacing the HTML that will appear in your LoginViewBox div.

    Instead of this approach, i would recommend adding a label into the div. This would give you a final structure of:

    <div id="LoginViewBox">
          <asp:Label ID="LoginLabel" runat="server"/>
          <asp:HyperLink ID="linkLogout" runat="server" OnClick="LogOut"></asp:HyperLink>
    </div>
    

    (it’s been a while since I’ve done straight ASP.NET, so there might be more required attributes for the label control).

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

Sidebar

Related Questions

Hello guys can you please help me with this problem. When a simple image
Hello guys i have a problem streaming PDF files with php, i'm using this
Hello guys and thanks for your help as always. I am stuck on Asp.NET
Hello Guys I am trying to figure out why i am gettings this error
Hello guys Im having a problem in how to clear the previous activity after
Hello guys Im using advance notification manager this is the code Notification note =
Hello guys I have a problem with my application involving Lucene java library and
Hello Guys I've a request for you.I've Drinks, Menus and Users routes. I've this
Hello guys I have a map like this http://sinanisler.com/demo/map/ and as you can see
Hello Guys! Let's say I have some page which I got with this script:

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.