Hi,
here is a sample
Listview
and how to bind it from databse with links in the
Listview
to navigate to detail page with
querystring
<asp:listview runat="server" id="listViewEmp" itemplaceholderid="itemPlaceholder" xmlns:asp="#unknown">
<layouttemplate>
<table>
<tr runat="server" id="itemPlaceholder"></tr>
</table>
</layouttemplate>
<itemtemplate>
<tr>
<td>
<asp:hyperlink id="lnkView" runat="server" text="<%#Eval("Name") %>" navigateurl="<%#"ViewDetail.aspx?EmpID="+ Eval("EmployeeID") %>" />
</td>
</tr>
</itemtemplate>
</asp:listview>
and c# code to bind
private void Page_Load(object sender, System.EventArgs e)
{
string connString = "Your connectionstring";
string sql = @"Select * From Employees";
SqlConnection conn = new SqlConnection(connString);
SqlDataAdapter da = new SqlDataAdapter(sql, conn);
da.Fill(dataSet1, "employee");
DataTable dt = dataSet1.Tables["employee"];
listViewEmp.DataSource = dt;
listViewEmp.DataBind();
}
In this example there is a Link to view the details of Employee that will redirect to
Detail.aspx
Hope this will give you better idea to acieve your task.