Click here to Skip to main content
15,885,216 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
<asp:DataList ID="DataList1" runat="server" BorderColor="LightGreen" BorderStyle="None"
BorderWidth="1px" CellPadding="3" CellSpacing="2" Font-Names="Verdana" Font-Size="Small"
GridLines="None" RepeatColumns="1" RepeatDirection="Vertical"
Width="600" OnCancelCommand="DataList1_CancelCommand"
OnDeleteCommand="DataList1_DeleteCommand" OnEditCommand="DataList1_EditCommand"
DataKeyField="Id" OnUpdateCommand="DataList1_UpdateCommand"
onitemdatabound="DataList1_ItemDataBound">

<HeaderTemplate>
<asp:Label ID="lblArea" runat="server" Text="School Details">
</HeaderTemplate>
<itemtemplate>

<asp:Image ID="ImagePath" runat="server" ImageUrl='<%#Bind("ImagePath") %>' Width="150px"
Height="150px" />
School Name:
<asp:Label ID="lblName" runat="server" Text='<%# Bind("SchoolName") %>' align="center">
About School:
<asp:Label ID="Label1" runat="server" Text='<%# Bind("AboutSchool") %>' align="center">
Contact:
<asp:Label ID="Label2" runat="server" Text='<%# Bind("Contact") %>' align="center">
Address:
<asp:Label ID="lblAddress" runat="server" Text='<%# Bind("Address") %>'>
Website:
<asp:LinkButton ID="LinkButton1" runat="server" Text='<%# Bind("Website") %>'>LinkButton

<asp:Panel ID="pnlEdit" runat="server" Visible="false">
<asp:Button ID="btnEdit" runat="server" Text="Edit" CommandName="Edit" CssClass="btnstyle">

<asp:Button ID="btnDelete" runat="server" Text="Delete" CommandName="Delete" CssClass="btnstyle"
OnClientClick="return confirm('Are you sure you want to delete selected records')">


Posted
Comments
KaushalJB 6-Jan-15 2:28am    
Does your question and the content of question have any relation ?? Put some relevant information rather than just pasting some design code

I don't know how you're determining if admin or not, but once you do you can do something like this.

VB
if admin = true then
pnledit.visible = true
else
pnledit.visible = false
end if
 
Share this answer
 
On Page load event, you can check for user role. If user Is admin then set panel.visible = true else set it false
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900