public class CustomWebPart : System.Web.UI.WebControls.WebParts.WebPart
{
bool prop1=true;
[WebBrowsable(true), Personalizable(PersonalizationScope.Shared), WebDescription("prop1"), Category("Config"), WebDisplayName("prop1 visible")]
public bool Prop1
{
get { return prop1; }
set { prop1= value; }
}
bool prop2= true;
[WebBrowsable(true), Personalizable(PersonalizationScope.Shared), WebDescription("prop2
"), Category("Config"), WebDisplayName("prop2")]
public bool Prop2
{
get { return prop2; }
set { prop2= value; }
}
public CustomWebPart()
{
this.ChromeType = PartChromeType.None;
}
protected override void CreateChildControls()
{
base.CreateChildControls();
CustomUC control = (CustomUC )Page.LoadControl("~/_controltemplates/CustomUC .ascx");
control.Prop2= this.Prop2;
control.Prop1= this.Prop1;
this.Controls.Add(control);
}
}