Hi ramco1917,
Use window.location.href for redirection.
Refer below code.
HTML
<asp:Repeater ID="rptCustomers" runat="server">
<HeaderTemplate>
<table id="tblCustomers">
<tr>
<th>Name</th>
<th>Country</th>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td><asp:Literal ID="ltrlName" runat="server" Text='<%# Eval("Name") %>'></asp:Literal></td>
<td><asp:Literal ID="ltrlCountry" runat="server" Text='<%# Eval("Country") %>'></asp:Literal></td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript">
$(function () {
$('#tblCustomers td').on("click", function () {
var name = $(this).closest('tr').find("td").eq(0).html().trim();
var country = $(this).closest('tr').find("td").eq(1).html().trim();
window.location.href = "Home.aspx?Name=" + encodeURI(name) + "&Country=" + encodeURI(country);
});
});
</script>
Code
C#
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
System.Data.DataTable dt = new System.Data.DataTable();
dt.Columns.AddRange(new DataColumn[3] {
new System.Data.DataColumn("Id"),
new System.Data.DataColumn("Name"),
new System.Data.DataColumn("Country")
});
dt.Rows.Add(1, "John Hammond", "United States");
dt.Rows.Add(2, "Mudassar Khan", "India");
dt.Rows.Add(3, "Suzanne Mathews", "France");
dt.Rows.Add(4, "Robert Schidner", "Russia");
this.rptCustomers.DataSource = dt;
this.rptCustomers.DataBind();
}
}
VB.Net
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
If Not Me.IsPostBack Then
Dim dt As System.Data.DataTable = New System.Data.DataTable()
dt.Columns.AddRange(New DataColumn(2) {
New System.Data.DataColumn("Id"),
New System.Data.DataColumn("Name"),
New System.Data.DataColumn("Country")
})
dt.Rows.Add(1, "John Hammond", "United States")
dt.Rows.Add(2, "Mudassar Khan", "India")
dt.Rows.Add(3, "Suzanne Mathews", "France")
dt.Rows.Add(4, "Robert Schidner", "Russia")
Me.rptCustomers.DataSource = dt
Me.rptCustomers.DataBind()
End If
End Sub
Screenshot