I don't believe the SmartPart is built to support your requirement and you'd need to do one of two things:
- Create your own webpart from scratch that calls the ascx, passing it the personalized property
- Extend the smartpart, customising the piece that loads the ascx, passing it the personalized property
To me, it sounds like a good time to move beyond the smartpart. It's pretty simple to create a webpart that loads a usercontrol anyways.
This article on msdn talks includes samples and guidance on how to support personalization in a webpart. Your custom property will look something like the code below:
// Create a custom category in the property sheet.
[Category("Custom Properties")]
// Assign the default value.
[DefaultValue(c_MyStringDefault)]
// Property is available in both Personalization
// and Customization mode.
[WebPartStorage(Storage.Personal)]
// The caption that appears in the property sheet.
[FriendlyNameAttribute("Custom String")]
// The tool tip that appears when pausing the mouse pointer over
// the friendly name in the property pane.
[Description("Type a string value.")]
// Display the property in the property pane.
[Browsable(true)]
[XmlElement(ElementName="MyString")]
// The accessor for this property.
public string MyString
{
get
{
return _myString;
}
set
{
_myString = value;
}
}