开发者

SharePoint 2010: trying to understand life-cycle issues with visual web part

开发者 https://www.devze.com 2023-02-03 20:21 出处:网络
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.

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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号