Skip to content

WPSC and default custom properties values

June 5, 2006

The following post was retrieved from my SharePoint blog:

I was recently working on a web part that uses the Web Part Page Services Component (WPSC) and JavaScript to save updated custom property values when I ran into a rather annoying error.

I had done everything correctly in defining my custom property and used the correct namespace in the Properties collection of my Part variable. But I still couldn’t get a valid reference to the property in my script.

It turned out the problem was that my custom property had it’s default value (set to the same as the initial value) and so SharePoint didn’t bother storing it since, “Specifying the default value minimizes the Web Part’s storage requirements by storing the property’s value only if it is different from the default.” (WSS SDK)

My solution, make the custom property’s initial value differ from the default value so SharePoint has to store the property value.

Leave a Comment

Leave a Reply

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

You are commenting using your 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

%d bloggers like this: