title: Assigning Visible Property of the Button to a Static Method Result
body: <p>I am trying to hide the button based on the user's role using the following code: </p>
  
  <pre><code> &lt;asp:Button ID="btndisplayrole" Text="Admin Button" Visible='&lt;%= WebApplication1.SiteHelper.IsUserInRole("Admin") %&gt;' runat="server" OnClick="DisplayRoleClick" /&gt;
  </code></pre>
  
  <p>But when I run the above code I get the following error message: </p>
  
  <p>Cannot create an object of type 'System.Boolean' from its string representation '&lt;%= WebApplication1.SiteHelper.IsUserInRole("Admin") %>' for the 'Visible' </p>