Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hey,
It's been a long day, this is either going to be really straight forward or not possible
Can I conditionally include a macro that renders a usercontrol in a template?
Rich
You can include the usercontrol's macro and set the 'Visible' attribute in the code-behind based on a condition.
Thanks for your reply, this makes sense and is certainly one solution
Was wondering if there was a way to not call the usercontrol at all?
Well, if it's about performance, maybe you could use 'LoadControl()' and add the usercontrol to a placeholder or a panel at runtime when a condition is true?
Thanks for your reply.
Found a solution here :)
http://our.umbraco.org/forum/templating/templates-and-document-types/15707-if-statement-on-masterpage?p=0#comment57895
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
Conditionally include user control
Hey,
It's been a long day, this is either going to be really straight forward or not possible
Can I conditionally include a macro that renders a usercontrol in a template?
Rich
You can include the usercontrol's macro and set the 'Visible' attribute in the code-behind based on a condition.
Hey,
Thanks for your reply, this makes sense and is certainly one solution
Was wondering if there was a way to not call the usercontrol at all?
Rich
Well, if it's about performance, maybe you could use 'LoadControl()' and add the usercontrol to a placeholder or a panel at runtime when a condition is true?
Hey,
Thanks for your reply.
Found a solution here :)
http://our.umbraco.org/forum/templating/templates-and-document-types/15707-if-statement-on-masterpage?p=0#comment57895
Rich
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.