How to change control properties programmatically

   —   
This article shows how to change properties of CMSListMenu control.
How to set programatically control properties such as path/maxrelativelevel:

You will need to change StopProcessing property of control to true:
<cms:CMSListMenu ID="ListMenu" runat="server" ClassNames="CMS.MenuItem" StopProcessing="true" />

And then you can use following code to set necessary properties in Page_Load event of code behind:

this.ListMenu.StopProcessing = false;
this.ListMenu.Path = "/Partners%";
this.ListMenu.ReloadData(true);




See also:

Applies to: Kentico CMS 3.x, 4.x
Share this article on   LinkedIn

Juraj Ondrus

Hi, I am the Technical support leader at Kentico. I'm here to help you use Kentico and get as much as possible out of it.