This may help you
First Page
protected void Page_Load(object sender, EventArgs e)
{
LoadRetrieve();
}
public void LoadRetrieve()
{
SqlConnection conn = new SqlConnection(ConnString);
string selectSql = "Select * from quest_categories ";
SqlCommand cmd = new SqlCommand(selectSql, conn);
conn.Open();
SqlDataReader dr = cmd.ExecuteReader();
DataTable dt = new DataTable();
dt.Load(dr);
conn.Close();
Session["ddcity"] = dt;
ddCity.DataSource = dt;
ddCity.DataTextField = "City";
ddCity.DataValueField = "Sr_No";
ddCity.DataBind();
}
Second Page
protected void Page_Load(object sender, EventArgs e)
{
if(Session["ddcity"]!=null)
{
DataTable dt = (DataTable) Session["ddcity"];
ddCity.DataSource = dt;
ddCity.DataTextField = "City";
ddCity.DataValueField = "Sr_No";
ddCity.DataBind();
}
}
if you feel it useful then don't forget to accept the solution and vote it up :)