开发者

pass a ToolPart value to a user control of a custom WebPart in Sharepoint 2007

I have created a Custom WebPart that has a UserControl. I have added a Custom ToolPart(dropdown) to it as well. What i want to achieve is that as a selection is made in the Custom ToolPart Dropdown;the value is to be passed into the code behind of the UserControl. I tried to use the Custom properties of the ToolPart to pass the dropdown Value but co开发者_运维百科uldnt do so. Then,i declared a public property in the UserControl Class but that worked onl


You should use Synchanges() and ApplyChanges() to pass values between ToolPart and WebPart. Once the value is passed from ToolPart to WebPart you can access the web part property from within the UserControl by using a hidden field and assigning the value to the hidden field and retrieving it from the user control.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜