0

I'm doing expose the ClientSideEvent and I using [PersistenceMode(PersistenceMode.InnerProperty)].

Aspx code:

<uc1:WebUserControl2 ID="WebUserControl21" runat="server" >
    <TestProperty></TestProperty>
</uc1:WebUserControl2>

When I type the < TestProperty>< /TestProperty> , it will show the 'System.Web.UI.UserControl' does not have a public property named 'TestProperty' in design view. What is the problem and how to solve it?

Behind code:

[ParseChildren(true)]
public partial class WebUserControl2 : System.Web.UI.UserControl
{

    [PersistenceMode(PersistenceMode.InnerProperty)]
    public String TestProperty
    {
        get
        {
            return ViewState["TestProperty"] as string;
        }
        set
        {
            ViewState["TestProperty"] = value;
        }
    }
}
user1328360
  • 33
  • 1
  • 6

1 Answers1

0

This is old issue pls refer to link. ASP.NET Custom/User Control With Children and How can I include additional markup within a 'Content' inner property of an ASP.Net WebControl? and this http://pastebin.com/hLq4bsC5

Community
  • 1
  • 1
DevProve
  • 190
  • 1
  • 16
  • http://msdn.microsoft.com/en-us/library/36574bf6(v=vs.85).aspx Please scroll down until the end of the page. – DevProve Apr 23 '12 at 10:06