In portal engine, we can always set "Display to roles" property to manage the webpart is only shown to certain roles. However, when I work in ASPX templates mode, I could not find this property in the webpart.
What is the best way to do this in ASPX templates?
Kentico: version 8
Question: "What is the best way to do this in ASPX templates?"
Answer: Use portal mode and create a webpart.
All ASPX mode joking aside...
If you MUST use ASPX mode:
panel.Visible = CMS.Membership.MembershipContext.AuthenticatedUser.IsInRole("YourRole");
Please, sign in to be able to submit a new answer.