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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T22:44:32+00:00 2026-05-18T22:44:32+00:00

I want to customize a webcontrol that can be used like this: <cc1:TitleEx runat=server

  • 0

I want to customize a webcontrol that can be used like this:

<cc1:TitleEx runat="server" Theme="Sky" DemoUrl="what.swf" Left="150" Width="250">
       <asp:Literal ID="Literal1" runat="server"></asp:Literal>
</cc1:TitleEx>

The base class is:

[Bindable(true)]
[Category("Appearance")]
[DefaultValue("")]
[Localizable(true)]
[PersistenceMode(PersistenceMode.InnerDefaultProperty)]
public string Text
{
   get
   {
    String s = (String)ViewState["Text"];
    return ((s == null) ? String.Empty : s);
   }
   set
   {
    if (this.HasControls())
     {
        this.Controls.Clear();
     }
    ViewState["Text"] = value;
   }
  }

/// <summary>
/// child control's content
/// </summary>
protected StringBuilder HtmlContent = new StringBuilder();

protected override void AddParsedSubObject(object obj)
{
  if (obj is LiteralControl)
  {
    HtmlContent.Append(((LiteralControl)obj).Text);
    this.Text = HtmlContent.ToString();
  }
  else
  {
   if (obj != null)
   {
     HtmlContent.Append(GetControlHtml(obj as Control));
     this.Text = HtmlContent.ToString();
   }
  }
}

/// <summary>
/// get the child controls' html
/// </summary>
protected string GetControlHtml(Control ctl)
{
   StringBuilder sb = new StringBuilder();
   StringWriter tw = new StringWriter();
   HtmlTextWriter writer = new HtmlTextWriter(tw);
   ctl.RenderControl(writer);
   sb.Append(writer.InnerWriter.ToString());
   return sb.ToString();
}

My problems are when I set a string to this literal control in Page_Load(), but the string cannot display. I also try to set the value in OnPreInit(), OnPreLoad() but still have no any luck.

Is there anybody has met this issue before?

How do you solve this problem?

  • 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-18T22:44:32+00:00Added an answer on May 18, 2026 at 10:44 pm

    i have found out the answer by reflect the panel.
    here is my solution.http://www.cnblogs.com/coolkiss/archive/2010/12/30/1921494.html

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

Sidebar

Related Questions

I want to customize a .NET build process so that I can run an
I want to customize Edit Field like in this link http://www.hostingpics.net/viewer.php?id=44669634im.png . I find
I want to customize my google checkout pages in my website like this site
I want to customize the radio buttons so instead of being like this empty
HA ii everybody,i want to customize the table-view cell like the image shown below,that
I want to customize the folders that are used to save my images for
I want to customize ToolStripMenuItem by overriding OnPaint function. This is a MyToolStripMenuItem: public
I have mp3 catalog portal and I want to customize my urls. I used
I want to customize next/previous posts links pagination to this structure: <!--PAGINATION--> <a href=#prev_post_link#
I want to customize Textselection dialog of webview.(When we press longclick at that time

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.