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

  • Home
  • SEARCH
  • 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 545665
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T10:47:08+00:00 2026-05-13T10:47:08+00:00

I have bunch of HTML code I am using to make rounded edge boxes

  • 0

I have bunch of HTML code I am using to make rounded edge boxes on my controls. Is there a way to take this code and turn it into some kind of control or something so I do not have to keep pasting 10 lines of HTML code around everything I do?

<div id="BottomBody">
    <div class="box1024" >
        <div class="content1024">
            <div class="top1024"></div>
            <h1>My Header Information</h1>
            <hr />
            <p>Some text for everyone!</p>
        </div>
        <div class="bottom1024">
            <div></div>
        </div>
    </div>
</div>

One additional thing to note, the number HTML tags used inside the inner most DIV will change depending on where I use it in my site. So in some cases I will only have 1 tag and 1

tag but in other cases I could have 1 tag, 1

tag, 3 tags, and a HTML table. How can I make that work?

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

    Yes, you’re thinking of a UserControl. Extract the relevant HTML out, paste it into a UserControl .ascx template.

    Now in your case, you’ll probably want the text to be customizable, am I right? So you’ll need to replace the <h1> through </p> bit with an ASP.NET label. The resulting .ascx HTML (not counting the @Control directive) will look something like:

    <div id="BottomBody">
        <div class="box1024" >
            <div class="content1024">
                <div class="top1024"></div>
                <asp:Label runat="Server" id="label1" />
            </div>
            <div class="bottom1024">
                <div></div>
            </div>
        </div>
    </div>
    

    Alternatively, you could do two labels — one for the header, one for the main text. Or even just have the header be runat="Server" itself.

    Next, you’ll write a little bit of code in the .ascx code-behind file to expose the label’s (or labels’, as the case may be) Text property. This would probably look something like:

    public string Text
    {
        get { return label1.Text; }
        set { label1.Text = value; }
    }
    

    If you’re in an ASP.NET MVC world, use your Model data instead of a label, and pass in the desired display text string as the model data.

    Edit

    Addressing the update to the question:

    One additional thing to note, the
    number HTML tags used inside the inner
    most DIV will change depending on
    where I use it in my site. So in some
    cases I will only have 1 tag and 1

    tag but in other cases I could have 1
    tag, 1

    tag, 3 tags, and a HTML table. How can
    I make that work?

    The exact same technique, assuming that the content you’re referring to is what’s within <div class="content1024">. The Text property of a label can contain any desired arbitrary HTML, and of course you can pass any arbitrary amount of HTML as a string to the Model if you’re using MVC.

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

Sidebar

Ask A Question

Stats

  • Questions 321k
  • Answers 322k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer In my opinion, going with Irrlicht or OGRE is a… May 14, 2026 at 12:43 am
  • Editorial Team
    Editorial Team added an answer This is covered here: How can I loop through every… May 14, 2026 at 12:43 am
  • Editorial Team
    Editorial Team added an answer How about a case insensitive match on: ([a-z][^a-z]*){3} Looks for… May 14, 2026 at 12:43 am

Related Questions

I am using jQuery's scrollTo plugin to scroll up and down my page, using
I'm using SubVersion and TRAC on a C# project I am working on, and
I have a page that has a bunch of user controls on it. I
I've been trying out IntelliJ IDEA for JavaScript editing, and I like it so
I am working on finding a good way to make user submitted data, in

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.