Problem most likely is with the QueryString. Everything falls apart when I go back from results page to search page. I use the QueryString to check all boxes that were checked before the results page is generated. This time I can uncheck checked boxes, but only visually. The results page will be generated as if they were still checked.
Here is simple example of it. I have added checkbox and a button...
protected void Page_Load(object sender, EventArgs e)
{
if (Request.QueryString["B1"] != null)
{
CheckBox1.Checked = true;
}
}
protected void Button1_Click(object sender, EventArgs e)
{
string QString = null;
if (CheckBox1.Checked)
{
QString += "?B1=1";
}
Response.Redirect("/TestPage1.aspx" + QString);
}
If I go to Default.aspx and if I add "?B1=1"(Default.aspx?B1=1) I get page where checkbox is checked. If I uncheck it and press Button1, I will be redirected to page "TestPage1.aspx?B1=1"
Does anyone have a solution to this problem?