Using SharePoint Designer, users can update WebPart properties directly via the code pane. Now, if this is a requirement for you, you’ll notice that when editing a custom version three WebPart (System.Web.UI.WebControls.WebParts.WebPart) that the properties are displayed as attributes of the WebPart element:
<webpart:test_webpart runat="server" CustomProperty="custom value"></webpart:test_webpart>
I’ve trimmed the above to make it more readable, the real element would be far longer and all on one line.
To make it easier for users to update properties via SPD and to move the properties to their own child elements, one option available is to make a few changes to your WebPart.
- Change the WebPart to inherit from the version 2 class – Microsoft.SharePoint.WebPartPages.WebPart
- Add the SupportsAttributeMarkup(false) attribute to the WebPart class
- For the property you want displayed as a child element, ensure the property attribute used for storage is WebPartStorage(Storage.Shared) and not Personalizable(PersonalizationScope.Shared). The storage type used is not important.