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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:33:19+00:00 2026-05-27T04:33:19+00:00

Is there a way in Composite C1 to manage static text in ASP.NET usercontrols

  • 0

Is there a way in Composite C1 to manage static text in ASP.NET usercontrols used on pages through the backend?

  • 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-27T04:33:20+00:00Added an answer on May 27, 2026 at 4:33 am

    In this answer I’m asuming you would like the “static text” to be maintained via a Visual Editor (html document), allowing your users to do heading, styling, bold etc. If you are just going for a simple large textbox this can be simplified.

    Start by creating a new Global Data Type on the Data perspective – name it (in the code sample below, I named it Maw.Content) and give it these two fields:

    • FieldKey string(32) (Widget: the default TextBox)
    • FieldContent string(Unlimited) (Widget: Composite.Widgets.String.VisualXhtmlEditor)

    Once you save your new data type you can add ‘records’ to it – and specify a field key and related content.

    This should take care of managing the content – the UI you get should be pretty user friendly. You can right click the data type in the tree and use the command “Show in Content perspective” which will make your data type show up on Content | Website Items. This way your users do not have to use the Data perspective at all.

    Consider limiting user access to the data folder to just “Edit”, in case you do not need users to add/delete items. Right click the folder containing data items and slect ‘Edit Permissions’.

    Outputting the XHTML from a named field
    In your user controls you can grab the html related to s specific FieldKey like this:

    using System;
    using System.Linq;
    using System.Xml.Linq;
    using System.Web.UI;
    using Composite.Data;
    using Composite.Core.Xml;
    
    public partial class Default2 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string fieldKey = "SomeKeyHere";
            string xhtmlString;
    
            using( var connection = new DataConnection())
            {
                xhtmlString = connection.Get<Maw.Content>().Where(f => f.FieldKey == fieldKey).Select(f => f.FieldContent).FirstOrDefault();
            }
    
            if (xhtmlString != null)
            {
                XhtmlDocument htmlDoc = XhtmlDocument.Parse(xhtmlString);
                foreach (XNode bodyNode in htmlDoc.Body.Nodes())
                {
                    this.Controls.Add( new LiteralControl(bodyNode.ToString()));
                }
            }
            else
            {
                this.Controls.Add(new LiteralControl("Unknown FieldKey: " + fieldKey));            
            }
    
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there some way to intercept the HTML output stream in asp.net and make
Is there a way in spring jdbc to return a composite primary key when
Is there any way to change the composite mode of a UIView background say
Is there a way of creating a composite field that can have multiple values,
Is there a way to have REQUIRED messages for different kinds of composite components?
Is there a way of setting a managed bean parameter in a composite component
Is there a way to create a composite key in Hibernate, with annotations, without
Is there a way I can create a composite component that can receive an
In my ASP.Net project which I am currently trying to move to Composite I
I'm trying to compose a dynamic URL, is there any easier way to append

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.