I am trying to hide a linkbutton dynamically depending on the role the user is in. I can hide my other linkbuttons that are located inside a gridview easy but when i use the same method outside of the gridview it does not work. Also if I hardcode visibility to false it hides it but when i am doing it dynamically it is not working.
\\This is in the Codebehind
protected bool isSuperUser()
{
return Roles.IsUserInRole("LMSuperUser");
}
\\This is in the ASPX page in a Template inside of a GridView and this WORKS
<ItemTemplate>
<asp:ImageButton ID="ImageButton7" runat="server" CommandArgument="Edit" CommandName="Edit"
ImageUrl="~/images/reply.gif" ToolTip="Edit" Visible='<%# isSuperUser() %>' />
...
Go to the complete details ...