SharePoint Web Part XML Properties

When we creating a webpart via Visual Studio. Visual Studio will automatically created 1 file xml that contain default property of the webpart. We can add more the properties on that file so when user try to use our webpart it setup default it will taken base on the xml webpart properties that we already added.

Here are below the sample webpart properties that we can used for our webpart code :

<webParts>
    <webPart xmlns="http://schemas.microsoft.com/WebPart/v3">
        <metaData>
            <type name=yourTypeHere" />
            <importErrorMessage>Cannot import this Web Part.</importErrorMessage>
        </metaData>
        <data>
            <properties>
                <property name="AllowClose" type="bool">True</property>
                <property name="AllowConnect" type="bool">True</property>
                <property name="AllowEdit" type="bool">True</property>
                <property name="AllowHide" type="bool">True</property>
                <property name="AllowMinimize" type="bool">True</property>
                <property name="AllowZoneChange" type="bool">True</property>
                <property name="CatalogIconImageUrl" type="string" />
                <property name="ChromeState" type="chromestate">Normal</property>
                <property name="ChromeType" type="chrometype">Default</property>
                <property name="Description" type="string">My WebPart</property>
                <property name="Direction" type="direction">NotSet</property>
                <property name="ExportMode" type="exportmode">All</property>
                <property name="Height" type="unit" />
                <property name="HelpMode" type="helpmode">Navigate</property>
                <property name="HelpUrl" type="string" />
                <property name="Hidden" type="bool">False</property>
                <property name="Title" type="string">Web Part Title</property>
                <property name="TitleIconImageUrl" type="string" />
                <property name="TitleUrl" type="string" />
                <property name="Width" type="unit" />
            </properties>
        </data>
    </webPart>
</webParts>
Happy Sharepoint-ing

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.