1

I am trying to hide a ASP.NET Table row, but below code part is not working, I don't know what is wrong with the syntax.

Not Working:

<asp:TableRow runat="server" Visible='<%# Roles.IsUserInRole("ARoleThatIsNotInDatabase") %>'>
</asp:TableRow>

Working:

<asp:TableRow runat="server" Visible='False'>
</asp:TableRow>

Working:

if (System.Web.Security.Roles.IsUserInRole("ARoleThatIsNotInDatabase"))
{//Not Entering this area as expected
}
4

1 回答 1

1

按照要求:

仔细检查你实际上是在打电话

this.DataBind();

在您的页面上

于 2012-07-27T08:33:50.810 回答