sql query structure:-
Create table Detail
(
FIRST_NAME varchar(50),
FATHER_NAME varchar(50),
FAMILY_NAME varchar(50)
)
Insert into detail values('Prince','Rakesh','adkk')
//Default2.aspx page is
<pre lang="xml"><%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:DataList ID="DataList1" runat="server">
<ItemTemplate>
<%# DataBinder.Eval(Container.DataItem,"FIRST_NAME" ).ToString()%> + <%# DataBinder.Eval(Container.DataItem,"FATHER_NAME").ToString() %>
+ <%# DataBinder.Eval(Container.DataItem,"FAMILY_NAME").ToString() %>
<a href= '<%# "default3.aspx?vID="+ DataBinder.Eval(Container.DataItem,"Name") %>'>Name</a>
</ItemTemplate>
</asp:DataList>
</div>
</form>
</body>
</html
>
Now default2.aspx.cs is
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
public partial class Default2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection(
SqlDataAdapter adapter = new SqlDataAdapter("Select FIRST_NAME,FATHER_NAME,FAMILY_NAME,FIRST_NAME+FATHER_NAME+FAMILY_NAME as 'Name' from Detail", con);
DataSet ds=new DataSet();
adapter.Fill(ds);
DataList1.DataSource = ds.Tables[0];
DataList1.DataBind();
}
}
now default3.aspx is
<pre lang="xml"><%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default3.aspx.cs" Inherits="Default3" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
</form>
</body>
</html
>
NOw default3.aspx.cs is
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class Default3 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
I hope your problem is solve. because above code is work successfully in my computer