SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Let's say I have a reference to a web part that I got by using a SPLimitiedWebPartManager. How can I set the custom properties of that web part? For example, if it is a stock ticker web part, how do I set the value of the stock symbol using the object model? Do I have to use reflection to accomplish this?

My goal is to be able to edit the properties of personal web parts using ajax instead of having to do all of the full round trips and post backs to the server.

share|improve this question
up vote 1 down vote accepted

Get the WebPart reference to the object (cast the type you're after), the properties for the web part should be exposed as any other object.

share|improve this answer
I suppose this would be easier than reflection, I was just hoping for some built in SharePoint way of handling this without reflection or casting. Thanks again. – TehOne Mar 3 '11 at 23:35
Well the SPLimitedWebPartManager can get you the WebPart object. Your WebPart will inherit from that class - so you just do something like MyWebPart webPart = mySPLimitedWebPartManager.WebParts[id]; – James Love Mar 3 '11 at 23:42

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.