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;
}
}
}