Hi there. I am trying to hide the link in the short list for users that are not registered. In other words, I want everyone to see that the file is there, but only be able to download it if they are logged in. I keep getting the error "Object reference not set to an instance of an object." In the "visible" attribute of the placeholder I have tried Request.IsAuthenticated, Me.User.IsInRole("Registered Users"), Me.UserInfo.IsInRole("Registered Users"), Context.Current.User.IsInRole("Registered Users"), and a few others. When I manually set the property to "true" and "false" it works, so I know the error has to do with the code in the block. Can you help please?
Here is the code I am using:
<asp:PlaceHolder ID="plAllowed" runat="server" Visible='<%# Me.User.IsInRole("Registered Users") %>'>
<%#DataBinder.Eval(Container, "DataItem.Title")%>
<asp:PlaceHolder ID="plNotAllowed" runat="server" Visible='<%# !Me.User.IsInRole("Registered Users") %>'>
<%#DataBinder.Eval(Container, "DataItem.Title")%>
Thanks in Advance!