Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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 stackoverflow.com 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

 
discard

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

Browse other questions tagged or ask your own question.