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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T13:44:58+00:00 2026-06-06T13:44:58+00:00

I have an asp.net UserControl that writes HTML content from a SharePoint list to

  • 0

I have an asp.net UserControl that writes HTML content from a SharePoint list to a Literal control. Currently I insert a title in h5 tags before each SharePoint list item I write to the Literal. Instead of having the title hardcoded to be placed in h5 tags, I’d like to expose a public property of my user control that lets me define the html format for the title. This is a little different from the templated user control questions I’ve found so many of because it’s not really a template for the user control. I just need a string containing html. Here’s what I’m looking to do:

public class MyUserControl: UserControl
{
    public string TitleFormat { get; set; }

    private void ShowContent()
    {
        ...
        string output = String.Format(TitleFormat, title) + someContent;
        ltlOutput.Text = output.
    }
}

In markup:

<UC:MyUserControl id="muc1" runat="server">
    <TitleFormat>
        <a href="www.somewhere.com"><h3>{0}</h3></a>
    </TitleFormat>
</UC:MyUserControl>

How can I set this up?

  • 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-06T13:44:59+00:00Added an answer on June 6, 2026 at 1:44 pm

    Here is the answer (provided by Decker Dong in the asp.net forums):

    To nest another class into one, you have to declare a new property but
    just declare it is an InnerProperty. And set its Design properties.
    Now here’s a full sample for you:

    [ParseChildren(true),PersistChildren(false)]
    public partial class MyUserControl : System.Web.UI.UserControl
    {
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
        [PersistenceMode(PersistenceMode.InnerProperty)]
        public string TitleFormat
        {
            get;
            set;
        }
    
        protected void Page_Load(object sender, EventArgs e)
        {
    
        }
    }
    

    With these attributes you can use the control as written in the question.

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

Sidebar

Related Questions

I have an asp.net usercontrol that contains a jQuery UI Dialog Control. All works
I have an ASP.Net UserControl that looks like this: <%@ Control Language=C# AutoEventWireup=true CodeBehind=WebUserControl1.ascx.cs
I have an asp.net usercontrol (ascx) that inherits from an abstract class (that inherits
I have a asp.net usercontrol (.ascx). the user control has a HTML hidden field.
I have a partial view (UserControl) that implements a simple pager in my Asp.Net
I have a usercontrol that is in an asp.net page that contains a button.
I've been tasked with porting/refactoring a Web Application Platform that we have from ASP.NET
I have an ASP.Net application that has a UserControl that needs to be rendered
I have an ASP.NET WebForms control (derived from Control, not WebControl, if it helps)
I have an ASP.NET user control that I want to write some dynamic Javascript

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.