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 wonder if someone could help me understand whats going on here. I have a web part with various web part properties. I have a class that inherits the web part class so that I can access my web part properties from my new class.

This works from the point of view that I can access the web part properties however the value is always the properties default value and not the stored property value.

If I log the property just before calling a method in my new class it logs out the correct value. With the exact same logging line in my new classes method it logs out the proprieties default and not its actual value.

share|improve this question

migrated from Apr 4 '13 at 5:50

This question came from our site for professional and enthusiast programmers.

To clarify, you added your "inherited" web part to a page, but your code cannot access the property values that you set via the web interface? – Chloraphil Apr 4 '13 at 16:52
Could you be confusing the difference between a web part and an instance of a web part? – Chloraphil Apr 4 '13 at 16:54
You are absolutely right Chloraphil I simply got confused between a web part and an instance of a web part - thank you for helping me see sense! – user2239744 Apr 5 '13 at 10:06
Glad you figured it out! We all get confused sometimes. – Chloraphil Apr 5 '13 at 14:18

Your Answer


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

Browse other questions tagged or ask your own question.