this.page.LoadControl(_ascxPath);
In theory, a control can be added through
- dynamically in CreateChildControls() of web part file
- declarative in ascx file of user control
- dynamically in Page_load() of user control's code behind
adding a custom property is very easy now, all need to do is add the following 2 attributes to any property: [WebBrowsable(true), Personalizable(true) ]
in .webpart, you can add default velues just as any other OOB properties
As custom properties are open to injection of user script (good or bad), SharePoint 2010 introduce 2 new flags to enforce security at both webpart level and property level:
SafeAgainstScript attribute in
[RequiresDesignerPermission] attribute for web part's property
see here for more details