Author: DannyT | Posted on: 7/2/2008 10:12:12 AM | Views : 315

I have a function in my code behind akin to this:

protected bool CheckRole(string roleName)
{
return User.IsInRole(roleName);
} Which i call in something like this:<asp:HyperLink id="myLink" runat="server" text="secure edit button" visible='<% # CheckRole("Some Rolename") %>' NavigateUrl="whatever.aspx" />This works fine for controls that are part of a bound repeating item (E.g. repeater or datalist etc) but I want to do the same for individual controls that just exist on the page. Is this possible or do I just have to write it from the code-behind?I'd prefer it to be in the aspx for consistency and ease of changing really.  ...

Go to the complete details ...