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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T22:48:12+00:00 2026-05-16T22:48:12+00:00

I am almost too embarrassed to ask this question, but here we go… I

  • 0

I am almost too embarrassed to ask this question, but here we go…

I am not an expert with user controls, and need some design advise regarding trying to achieve a specific desired functionality.

The goal is to have a usercontrol that would render as a complex structure of html elements and css to form an elegant container box. The problem lies in how to populate the contents of the box as each instance of the usercontrol would have its own individual HTML content. The content container div of the usercontrol would be nested deep within the structure of the rendered html. It is undesirable to programmatically set the contents of the usercontrol, or use properties.

In psuedo-code, the desired syntax would be something like:

<usercontrol Title="Some Title"><p>some random html content</p></usercontrol>

A sample of the rendered usercontrol would be:

<div class="CommonBox">
    <div class="Title">Some Title</div>
    <div class="Content"><p>some random html content</p></div>
</div>

I hope my explanation is adequate. Does this make sense to anyone or is the desired functionality unachievable?

Cheers!

EDIT

I attempted the templated user control suggestion in the hopes of coming to a decent solution. I “waybacked” this site and now have a working templated user control. My next question is, how can I programmatically access the controls nested within the template… say there is a textbox control in the “Description” template from the example link and I want to set its value programmatically? Is this possible?

  • 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-16T22:48:13+00:00Added an answer on May 16, 2026 at 10:48 pm

    What you’re looking for is definitely possible. One solution is to create a templated user control. In the end you can define the contents similar to how your example looks. Something like:

    <uc:MyControl Title="Some TItle" runat="server">
        <ContentsTemplate>
            <p>some random html content</p>
        </ContentsTemplate>
    </uc:MyControl>
    

    Here’s a simple how-to. I’ve done this in the past with success. There are lots of resources found through Google as well on the topic.

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

Sidebar

Related Questions

This question is so basic that I'm almost embarrassed to ask it, but it's
I'm almost embarrassed to ask help with this. It's not like I've never done
This question is almost identical to How to efficiently count the number of keys/properties
I know my question is too inaccurate to answer but let me give you
I had a discussion with some colleagues mentioning that there are not too many
I'm almost positive this topic has been addressed somewhere because my question feels so
I searched for a while on this topic and found some results too, which
I almost figure this out, can anyone tell me as to why my $.unblock
I almost done my coding for a specific program i have. I just need
The code for this is too long to post so Ill just describe it.

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.