For sorting data, we have links that correspond to the columns in the employee result set, in the header section of the Repeater control.
<tr> <th> <asp:LinkButton id="Emp_Code" OnClick="EmpCodeSort" Text="Employee Code" runat="server" /></th> <th> <asp:LinkButton id="Emp_Name" OnClick="EmpNameSort" Text="Employee Name" runat="server" /></th> <th> <asp:LinkButton id="Emp_Basic" OnClick="EmpBasicSort" Text="Employee Basic" runat="server" /></th> <th> <asp:LinkButton id="Dept_Code" OnClick="DeptCodeSort" Text="Department Code" runat="server" /></th> </tr>
All of these link buttons have associated event handlers that get called on their OnClick
events. These event handlers set the sortColumn
variable to the name of the column on which the sort has to be performed. Refer to the following code snippets:
protected void EmpCodeSort(object sender, EventArgs e) { sortColumn...