Hello Morris,
Thanks for your reply.
I think the problem now is not due to syntax error. The Visible='<%#
User.IsInRole("administrator") %>'/> like expression should correctly
return a boolean value. Based on my analysis, what you can check are the
following two things:
1. programmatically print out the User.IsInRole("administrator") value to
make sure it return the expected value (use response.write....).
2. for <%# User.IsInRole("administrator") %> expression, it is used for
databinding(different from <% %> expression), and it won't be executed
automatically if you do not perform databinding on the expression's
container or super container. Therefore, you should make sure you have
called databind method on the control which contains this expression. e.g.
================
<asp:LinkButton ID="LinkButton1" runat="server"
Visible='<%# User.IsInRole("admin")
%>'>LinkButton</asp:LinkButton><br />
protected void Page_Load(object sender, EventArgs e)
{
LinkButton1.DataBind();
}
====================
Hope this helps.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.