Click here to Skip to main content
15,905,508 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
ASP.NET
<asp:DataList ID="DataList1" runat="server" >
        <itemtemplate>
            <table>
                <tr>
                    <td>
                        School Name:
                        <asp:Label ID="lblName" runat="server" Text='<%# Bind("SchoolName") %>' align="center"> 
                    </td>
                </tr>
                <tr>
                    <td>
                        About School:
                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("AboutSchool") %>' align="center"> 
                    </td>
                </tr>
                <tr>
                    <td>
                        Contact:
                        <asp:Label ID="Label2" runat="server" Text='<%# Bind("Contact") %>' align="center"> 
                    </td>
                </tr>
                <tr>
                    <td>
                        Address:
                        <asp:Label ID="lblAddress" runat="server" Text='<%# Bind("Address") %>'>
                    </td>
                </tr>
                <tr>
                    <td>
                        Website:
                        <asp:LinkButton ID="LinkButton1" runat="server" Text='<%# Bind("Website") %>'>LinkButton
                    </td>
                </tr>
            </table>
            <asp:Panel ID="pnlEdit" runat="server" Visible="false">
                <asp:Button ID="btnEdit" runat="server" Text="Edit" >
                
                <asp:Button ID="btnDelete" runat="server" Text="Delete"  
                    OnClientClick="return confirm('Are you sure you want to delete selected records')">
        </itemtemplate>
Posted
Updated 4-Jan-15 3:50am
v2
Comments
DamithSL 4-Jan-15 1:36am    
when you want to hide the panel?
Member 11177087 4-Jan-15 5:45am    
Panel should be enable to the Admin Login only.

when a user login that panel should be disable

please suggest me
Kornfeld Eliyahu Peter 4-Jan-15 9:52am    
This may help you to understand ASP.NET templates, and create a solution for yourself...
http://www.codeproject.com/Articles/775111/Understanding-ASP-NET-Templates

As you have a database and you have information about all the users and info related to them whether the login person is simply a user or an Admin so retrieve that information on pageload event and on the basis of that just enable or disable your panel.
 
Share this answer
 
You need to use the item.FindControl("controlId") technique to find a control.

For hiding it, write the logic inside the ItemDataBound event.
 
Share this answer
 
hi,
on page load event,by default you can hide it. And when you are checking the User role (ex: Admin) then you can show it.
 
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