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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T10:12:00+00:00 2026-05-20T10:12:00+00:00

public class BlogComment { public int ID; public int UserID; public string Username; public

  • 0
public class BlogComment
{
    public int ID;
    public int UserID;
    public string Username;
    public string Comment;
    public DateTime Date;
    public int VotesUp;
    public int VotesDown;

    public Panel GetCommentPanel()
    {
        Panel WrapPanel = new Panel();
        WrapPanel.CssClass = "user-comment-wrapper";

        Panel VotePanel = new Panel();
        VotePanel.CssClass = "rfloat";
        HyperLink UpVote = new HyperLink();
        HyperLink DownVote = new HyperLink();
        UpVote.CssClass = "s vote-box vote-up";
        DownVote.CssClass = "s vote-box vote-down";
        UpVote.NavigateUrl="#";
        DownVote.NavigateUrl = "#";
        VotePanel.Controls.Add(UpVote);
        VotePanel.Controls.Add(DownVote);
        WrapPanel.Controls.Add(VotePanel);

        Panel UserTextPanel = new Panel();
        UserTextPanel.CssClass = "user-comment-txt";
        Literal UserText = new Literal();
        UserText.Text = this.Comment;
        UserTextPanel.Controls.Add(UserText);

        return WrapPanel;
    }

Trying to generate the following HTML:

<div class="user-comment-wrapper">
    <div style="float:right">
        <a class="s vote-box vote-up" href="#"></a>
        <a class="s vote-box vote-down" href="#"></a>
    </div>  
    <div class="user-comment-txt">
        Object comes with instantiated Department with empty atributes Object comes with instantiated Department with empty atributes Object comes with instantiated Department with empty atributes.Department with empty atributes Object comes with instantiated Department with empty atributes Object comes with instantiated Department with empty atributes.    
    </div>
    <div class="comment-info-wrapper">
        <div style="float:left">
            <strong>Posted by <a href="#">Tom</a></strong>
        </div>
        <div style="float:right">
            <strong><abbr class="timeago" title="2008-07-17T09:24:17Z">July 17, 2008</abbr></strong>
        </div>
        <div class="clear"></div>
    </div>            
</div>

I mean it works, but I can’t help but feel this design sucks.

  • 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-20T10:12:00+00:00Added an answer on May 20, 2026 at 10:12 am

    Just write the plain old-good HTML in your ASPX page.

    <div class="user-comment-wrapper">
        <div class="voting">
            <a class="s vote-box vote-up" href="#"></a>
            <a class="s vote-box vote-down" href="#"></a>
        </div>  
        <div class="user-comment-txt">
            <%: GetCommentContent() %>
        </div>
        <div class="comment-info-wrapper">
            <div class="author-info">
                <strong>Posted by 
                  <a href="#"> <%: GetCommentAuthor() %></a>
                </strong>
            </div>
            <div class="comment-info">
                <strong>
                  <abbr class="timeago" title="<%: GetShortCommentTime() %>">
                    <%: GetFriendlyCommentTime() %>
                  </abbr>
                </strong>
            </div>
            <div class="clear"></div>
        </div>            
    </div>
    

    Please not the additional classes applied. Then you can add CSS:

    .user-comment-wrapper .voting { float: right; }
    .comment-info-wrapper .author-info { float: left; }
    .comment-info-wrapper .comment-info { float: right; }
    

    Also you are injecting content using ASP.NET 4 <%:..%> (or it can be a usual <%=...%>, but make sure you HTML escape it).

    I don’t see any reason to manually create those absolutely unreadable server-side controls in order to render HTML.

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

Sidebar

Related Questions

public class Employee { public static void main(String[] args) { int j=3; staples[] stemp
public class Bird { private static int id = 0; private String kind; public
public class Account { public int pin; public int accountnumber; public string accounttype; public
public class Main { public static void main (String args[]) { int nums[]= {2,
public class Emp { public int ID { get; set; } public string Name
public class Bird { private static int id = 0; private String kind; public
public class Sample { public static void main(String[] args) { int year = 2012;
public class MyClass { public int Age; public int ID; } public void MyMethod()
public class Test { public static void main(String[] args) { } } class Outer
public class Address { public string ZipCode {get; set;} } public class Customer {

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.