When the edit button in the 'item template' is clicked, how is that associated with the 'edit template' to make the template appear?
<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="FormCrudAndSearch._Default" %>
<asp:Content ID="BodyContent" ContentPlaceHolderID="MainContent" runat="server">
<h1>Employee Record Manager</h1>
<div>
<asp:ListView ID="EmployeeList" ItemType="FormCrudAndSearch.Models.Employee" SelectMethod="GetSearchedItems" DataKeyNames="Id" UpdateMethod="UpdateEmployee" DeleteMethod="DeleteEmployee" OnSelectedIndexChanged="EmployeeList_SelectedIndexChanged" runat="server">
<EmptyDataTemplate>
<table>
<tr>
<td>Sorry, No Record Found. Try Again!</td>
</tr>
</table>
</EmptyDataTemplate>
<EmptyItemTemplate>
<td />
</EmptyItemTemplate>
<LayoutTemplate>
<div class="outerContainer">
<%-- A table. --%>
<table id="EmployeeTable">
<caption style="color:blue"><b>Employee List - Sorted by First Name</b></caption>
<tr style="background-color:darkgrey">
<th>Emp Id</th>
<th>First Name</th>
<th>Last Name</th>
<th>Salary</th>
<th>Contact Nbr</th>
<th>Date Of Birth</th>
<th style="width:140px;">Action</th>
</tr>
<tr runat="server" id="itemPlaceholder"></tr>
</table>
</div>
</LayoutTemplate>
<ItemTemplate>
<tr>
<td>
<%# Item.Id %>
</td>
<td>
<%# Item.FirstName %>
</td>
<td>
<%# Item.LastName %>
</td>
<td>
<%# Item.Salary %>
</td>
<td>
<%# Item.ContactNo %>
</td>
<td>
<%# Item.Date_Of_Birth %>
</td>
<td>
<asp:Button CommandName="Edit" Text="Edit" tooltip="Edit a record" CausesValidation="false" runat="server" />
<asp:Button CommandName="Delete" tooltip="Delete a record" CausesValidation="false" onclientclick="javascript:return confirm('Are you sure to delete this record?')" Text="Delete" runat="server" />
</td>
</tr>
</ItemTemplate>
<EditItemTemplate>
<tr>
<input type="hidden" name="EmpId" value="<%# Item.Id %>" />
<td>Emp Id:
<asp:TextBox ID="txtEmpId" runat="server" TextMode="SingleLine" Text='<%# BindItem.Id%>' />
</td>
<td>First Name:
<asp:TextBox ID="txtFName" runat="server" TextMode="SingleLine" Text='<%# BindItem.FirstName %>' />
</td>
<td>Last Name:
<asp:TextBox ID="txtLName" runat="server" TextMode="SingleLine" Text='<%# BindItem.LastName %>' />
</td>
<td>Salary:
<asp:TextBox ID="txtSalary" runat="server" TextMode="SingleLine" Text='<%# BindItem.Salary %>' />
</td>
<td>Contact Nbr:
<asp:TextBox ID="txtContactNo" runat="server" TextMode="SingleLine" Text='<%# BindItem.ContactNo %>' />
</td>
<td>Date of Birth:
<asp:TextBox ID="txtDOB" runat="server" TextMode="SingleLine" Text='<%# BindItem.Date_Of_Birth %>' />
</td>
<td>
<asp:Button BackColor="#ff0066" CommandName="Update" Text="Update" CausesValidation="false" runat="server" />
<asp:Button BackColor="#ff0066" CommandName="Cancel" Text="Cancel" CausesValidation="false" runat="server" />
</td>
</tr>
</EditItemTemplate>
</asp:ListView>
</div>