I have a custom control that inherits from PeopleEditor in my WebPart. In the custom control I have a custom property:
public string MyProperty
{
get
{
string text = (string)ViewState["myKey"];
if (text != null)
return text;
else
return string.Empty;
}
set
{
ViewState["myKey"] = value;
}
}
I set this property while OnInit of my WebPart. But after post back of this control ViewState comes without my property, it even doesn't contain myKey in the Keys.
Do you have any ideas how to creat a custom property which will not be lost after post back?