G
Guest
I want to set the visible of pnlEditButton according to current login.
However, the control is not a member of this(Page) and FindControl() returns
null.
protected void Page_Load(object sender, System.EventArgs e)
{
bool isAdmin = User.IsInRole("Administrators");
this.FindControl("pnlEditButton").Visible = isAdmin;
}
<aspataList ID="DataList1" runat="server" DataSourceID="ObjectDataSource1"
....>
<ItemTemplate>
<div class="membercard">
<aspanel id="pnlEditButton" runat="server">
</aspanel>
However, the control is not a member of this(Page) and FindControl() returns
null.
protected void Page_Load(object sender, System.EventArgs e)
{
bool isAdmin = User.IsInRole("Administrators");
this.FindControl("pnlEditButton").Visible = isAdmin;
}
<aspataList ID="DataList1" runat="server" DataSourceID="ObjectDataSource1"
....>
<ItemTemplate>
<div class="membercard">
<aspanel id="pnlEditButton" runat="server">
</aspanel>