title: Assign a value to drop down list on page_load
body: <p>I'm trying to assign value to a drop down list on the page_load, but it's not automatically get selected when the page loads up. But when I try to select another value from the drop down list, then the value assigned to it originally gets selected. I think it's something to do with the PostBack, My code is,</p>
  
  <pre><code>if (!string.IsNullOrEmpty(Request.QueryString["selectedReg"]))
      {
          string selectedReg = Request.QueryString["selectedReg"];
          ddlVehicleReg.SelectedIndex = ddlVehicleReg.Items.IndexOf(ddlVehicleReg.Items.FindByText(selectedReg));
      }
  </code></pre>
  
  <p>If I use if(!IsPostBack) still no luck, Any ideas? Thanks a lot in advance</p>