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

I have a webpart with a toolpart class. The toolpart renders fine, but how do I read/"get" the toolpart's value from the webpart class? ie if a button is pressed.

share|improve this question
up vote 2 down vote accepted

If its a custom ToolPart property you can check this MSDN link that is explaining you how to get toolpart values within a webpart

Getting custompropertytoolpart in a webpart


This link is more relevant to your question

MSDN getting/Updating toolpart class properties

To obtain a reference to the Web Part to update its properties, the ToolPart class has an accessor property called ParentToolPane that returns a reference to the ToolPane object. The ToolPane object is the class that keeps track of which Web Part is selected, and in turn, it has an accessor property called SelectedWebPart that returns a WebPart object for the current Web Part.

Hope it helps :)

share|improve this answer

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.