The user-defined control uses innerdefaultproperty to prompt "text content cannot be included"

Source: Internet
Author: User
I want to make a property value stored between the identifiers, like many server-side controls.

<Kvw: adctl id = "adctl1" runat = "server">
My advertisement content
</Kvw: adctl>

I do not know how to express it. The hyperlink control of the anti-encoding system found that
Persistencemode (persistencemode. innerdefaultproperty) [persistencemode (persistencemode. innerdefaultproperty), description ("hyperlink_text")]
Public Virtual string text
{
Get
{
//
}
Set
{
//
}
}


The control is successfully generated based on the gourd painting scheme and put it on the page for trial. The property value is as expected to go between labels, but when you return to the design interface, a prompt is displayed.
Cannot contain text content "...."

After careful comparison, the original class also has a limit of parsechildren (false ). In terms of words, that is to say, the control between them is not explained. Try to put a table in it. The value of text is empty. No wonder the hyperlink control overwrites the addparsedsubobject method protected override void addparsedsubobject (Object OBJ)
{
If (this. hascontrols ())
{
Base. addparsedsubobject (OBJ );
}
Else if (obj is literalcontrol)
{
This. Text = (literalcontrol) OBJ). text;
}
Else
{
String text = This. text;
If (text. length! = 0)
{
This. Text = string. empty;
Base. addparsedsubobject (New literalcontrol (text ));
}
Base. addparsedsubobject (OBJ );
}
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.