Portal Engine Questions on portal engine and web parts.
Version 7.x > Portal Engine > Evaluating Webpart property in master page aspx template View modes: 
User avatar
Certified Developer 8
Certified Developer 8
richard - 8/6/2013 6:45:35 PM
   
Evaluating Webpart property in master page aspx template
I have the following WebPart in my Master Page (aspx) layout.

I am trying to set the CombineWithDefaultCulture property dynamically - I have tried using Custom macros, macro resolver (API ) and the below approach (public function in code behind of the Master page) as well as trying to hook into the Webpart Init, Load and PreRender event handlers - nothing works.

Short of Cloning the web part(s) is there any way of doing this?

Note that the macro works when the same Webpart is added via portal pages.

<cms:listmenu runat="server" ID="wMenu" Path="/%" ClassNames="TNZ.ContentPage" MaxRelativeLevel="2"
WhereCondition="MenuItemGroup <> 'footer' OR MenuItemGroup IS NULL" RenderCssClasses="True"
ItemIdPrefix="tm" HideControlForZeroRows="False" ZeroRowsText="There are no menu pages."
CacheDependencies="##DEFAULT##" CombineWithDefaultCulture='<%# ValidationHelper.GetBoolean(CheckCulture(), false) %>' />

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 8/7/2013 3:40:52 AM
   
RE:Evaluating Webpart property in master page aspx template
Hi,

What were the exact attempts in the code behind? Have you reloaded the data for given web part? In this documentation you can see how to set a web part property dynamically in the code behind.

Best regards,
Juraj Ondrus

User avatar
Certified Developer 8
Certified Developer 8
richard - 8/7/2013 5:23:09 PM
   
RE:Evaluating Webpart property in master page aspx template
Thanks a lot Juraj

webpartID.ReloadData() fixed the issue.

Thanks

Richard