title: Remembering DropDownList state when redirecting
body: <p>I have DropDownList, which has some options to choose from. Now after when user selects one of the options, it has to click on a button, which is a redirection on the same page:</p>
  
  <pre><code>protected void Button4_Click(object sender, EventArgs e)
  {
      Response.Redirect("Graphs.aspx?Selection=" + DropDownList1.SelectedValue + "&amp;Date1=" + TextBox1.Text + "&amp;Date2=" + TextBox2.Text);
  }
  </code></pre>
  
  <p>I have to use redirection instead of postback, because I use flot which is javascript library and all the code has to be written again when user selects some other option. The problem is, when it redirects back, for some reason I can't make it to remember the value in the DropDownList, which has user previously selected. I tried this with this code:</p>
  
  <pre><code>protected void Page_Load(object sender, EventArgs e)
  {
      if (Request.QueryString["Selection"] == "TemperatureOUT")
      {
          DropDownList1.SelectedIndex = 0;
      }
      else if (Request.QueryString["Selection"] == "Dewpoint")
      {
          DropDownList1.SelectedIndex = 1;
      }
  }
  </code></pre>
  
  <p>The problem is, if for example user selects Dewpoint from DropDownList and then clicks on a button, which causes redirection, the new url should have:</p>
  
  <pre><code>Graphs.aspx?Selection=Dewpoint&amp;...
  </code></pre>
  
  <p>but instead, it says:</p>
  
  <pre><code> Graphs.aspx?Selection=TemperatureOUT&amp;...
  </code></pre>
  
  <p>Now if I remove that code from Page_Load it works, but it does not remember what has user selected before. Now I know that there has to be something with Page_Load. Isn't that when page is redirected, the Page_Load get's called, so it should look a the Selection value and print it out. So it has to be a problem with redirection, that for some reason does not set the selected value.</p>