in

SharePoint Blogs

The Best Place for SharePoint-related Blogs

kwanl's blog

WPSC and default custom properties values

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.

Comments

No Comments

Leave a Comment

(required )  
(optional )
(required )  
Add

Need SharePoint Training? Attend a SharePoint Bootcamp!

Posts (c) their respective authors. Everything else (c) 2007 SharePoint Experts