problem with session
i want to transfer data in several fields across web pages.\i noticed that when using sessions,it was selective when i want to retrieve the values in another pages data in dropdownlist controls were retrieved while textboxes were omitted i need help fast.,am using vs2005 with c#
Niradhip ChakrabortyPosted Mar 24, 2009, 12:57 PM
Your code is fine. May be before coming to this page, you are clearing the session value for textbox somewhere. Or may be you are not properly assigning textbox value to session. Please check this once again and let us know.
Akomolafe AdesinaPosted Mar 24, 2009, 11:59 AM
thanks my friends see the etract of the code
protected void Page_Load(object sender, EventArgs e)
{
Label1.Text = Session["State"].ToString();
Label2.Text = Session["Lic"].ToString();
Label3.Text = Session["Model"].ToString();
Label4.Text = Session["Make"].ToString();
Label5.Text = Session["Color"].ToString();
Label6.Text = Session["Type"].ToString();
string chas = Session["Chas"].ToString();
string eng = Session["Eng"].ToString();
Label7.Text = chas;
Label8.Text = eng;
Label9.Text = Session["CEng"].ToString();
Label10.Text = Session["Cy"].ToString();
Label11.Text = Session["Purp"].ToString();
Label12.Text = Session["LIDate"].ToString();
Label13.Text = Session["RCertNo"].ToString();
Label14.Text = Session["test"].ToString();
Label15.Text = Session["NLA"].ToString();
Label16.Text = Session["PReg"].ToString();
Label17.Text = Session["OName"].ToString();
Label18.Text = Session["OStat"].ToString();
Label19.Text = Session["OAddr"].ToString();
Label20.Text = Session["OTown"].ToString();
Label21.Text = Session["OMobile"].ToString();
Label22.Text = Session["OEmail"].ToString();
Label23.Text = Session["PName"].ToString();
Label24.Text = Session["NR"].ToString();
Label25.Text = Session["PStat"].ToString();
Label26.Text = Session["PAddr"].ToString();
Label27.Text = Session["PTown"].ToString();
Label28.Text = Session["PEmail"].ToString();
Label29.Text = Session["PMobile"].ToString();
}
when i used the label to retrieve the session values,only the dropdownlist controls were saved in the session variables,those of textboxes return no values on the labels
Akomolafe AdesinaPosted Mar 24, 2009, 11:59 AM
thanks my friends see the etract of the code
protected void Page_Load(object sender, EventArgs e)
{
Label1.Text = Session["State"].ToString();
Label2.Text = Session["Lic"].ToString();
Label3.Text = Session["Model"].ToString();
Label4.Text = Session["Make"].ToString();
Label5.Text = Session["Color"].ToString();
Label6.Text = Session["Type"].ToString();
string chas = Session["Chas"].ToString();
string eng = Session["Eng"].ToString();
Label7.Text = chas;
Label8.Text = eng;
Label9.Text = Session["CEng"].ToString();
Label10.Text = Session["Cy"].ToString();
Label11.Text = Session["Purp"].ToString();
Label12.Text = Session["LIDate"].ToString();
Label13.Text = Session["RCertNo"].ToString();
Label14.Text = Session["test"].ToString();
Label15.Text = Session["NLA"].ToString();
Label16.Text = Session["PReg"].ToString();
Label17.Text = Session["OName"].ToString();
Label18.Text = Session["OStat"].ToString();
Label19.Text = Session["OAddr"].ToString();
Label20.Text = Session["OTown"].ToString();
Label21.Text = Session["OMobile"].ToString();
Label22.Text = Session["OEmail"].ToString();
Label23.Text = Session["PName"].ToString();
Label24.Text = Session["NR"].ToString();
Label25.Text = Session["PStat"].ToString();
Label26.Text = Session["PAddr"].ToString();
Label27.Text = Session["PTown"].ToString();
Label28.Text = Session["PEmail"].ToString();
Label29.Text = Session["PMobile"].ToString();
}
when i used the label to retrieve the session values,only the dropdownlist controls were saved in the session variables,those of textboxes return no values on the labels
Niradhip ChakrabortyPosted Mar 23, 2009, 12:43 PM
It is not very clear. Can you please send us your code?