I cant understand whats wrong with this simple code.

Page load starts with filling textboxes with session data,

    tbgiris.Text = Convert.ToString(Session["giris"]);
    tbmail.Text = Convert.ToString(Session["mail"]);
    tbisim.Text = Convert.ToString(Session["isim"]);
    tbgrup.Text = Convert.ToString(Session["grup"]);
    tbkimlik.Text = Convert.ToString(Session["kimlik"]);
    tbadmin.Text = Convert.ToString(Session["admin"]);

This works fine. Then, I edit those textbox values manually in browser, and call the button function which must simply update the session values with given data in textboxes, and re-write textboxes as a confirmation,

    Session["giris"] = tbgiris.Text;
    Session["mail"] = tbmail.Text;
    Session["isim"] = tbisim.Text;
    Session["grup"] = tbgrup.Text;
    Session["kimlik"] = tbkimlik.Text;
    Session["admin"] = tbadmin.Text;

    tbgiris.Text = Convert.ToString(Session["giris"]);
    tbmail.Text = Convert.ToString(Session["mail"]);
    tbisim.Text = Convert.ToString(Session["isim"]);
    tbgrup.Text = Convert.ToString(Session["grup"]);
    tbkimlik.Text = Convert.ToString(Session["kimlik"]);
    tbadmin.Text = Convert.ToString(Session["admin"]);

This is where I fail. Session values stay same, does not get updated. If I change the session value to a static value in button function, like,

    Session["giris"] = "test string";

it works fine, updates the session and textbox. But if I try to get values from textboxes, code behaves like I have never changed texts of textboxes.

Thanks in advance

Related posts

Recent Viewed