I have a two checkboxes on different pages. I am sending the value from the first checkbox using session like this:
protected void Button4_Click(object sender, EventArgs e)
{
Session["VSSsnap"] = CheckBox1.Checked;
Response.Redirect("~/Addnewpolicy4.aspx");
}
I receive this session like this on the next page:
string vss = Session["VSSsnap"].ToString();
However, I want to put this value in a checkbox on the second page.
I tried this, but I get an error:
CheckBox1.Checked = Session["VSSsnap"].ToString();
I also tried this; when I debug, the values are also present (but not displayed by checkbox):
CheckBox1.Checked.Equals(Session["VSSsnap"]);
Any help would be greatly appreciated.