I have a page which is having many controller rendering but I want to execute only some of them based on any condition. Is it possible to do it in sitecore programmatically?
To do the same follow below steps:
- First you need to create custom personalization rule.
- Write you custom code which will inherit RuleContext Class, for check the condition where you will match value one which comes from web API and other you set in your rule.
- If both the value will be matched then show or hide your rendering bases on the condition.
For more details how to create custom Personalization rule, You can find more details here: Custom Personalization Rules in Sitecore