SharePoint 2010: trying to understand life-cycle issues with visual web part
I am building a visual web part which has a number of user-configurable properties. The web part will display news items and, optionally, automatically switch to the next item after a defined pause.
The problem I'm having is that the user control part has a timer whic开发者_运维技巧h fires events. These events reenter the user control (without going through the web part) and I see that when this happens the user control is in an unitialised state - i.e. the custom properties of the web part have not been applied. This causes the control to behave in it's default manner.
What am I doing wrong?
When you set property in your webPart, you need to bubble it down to the User control.
See creating custom properties for visual webparts: http://patricklamber.blogspot.com/2010/05/how-do-i-create-custom-properties-in.html
精彩评论