fill dropdown list by querystring
<p>I had drop down list and I want to fill it with data by specific condition 
i used this code but it was,t worked well </p>

<pre><code>&lt;cs&gt;
protected void Page_Load(object sender, EventArgs e)
    {
        Page.Title = "ThumbnailViewPage";

    if (Request.QueryString["Category_Id"] != null)
    {
        using (SqlConnection Con = Connection.GetConnection())
        {

            SqlCommand Com = new SqlCommand("GetProducFamilyTP2", Con);
            Com.CommandType = CommandType.StoredProcedure;
            Com.Parameters.Add(Parameter.NewInt("@Category_Id", Request.QueryString["Category_Id"]));
            SqlDataReader DR = Com.ExecuteReader();
            if (DR.Read())
            {
                DDlProductFamily.DataTextField = DR["Name"].ToString();
                DDlProductFamily.DataValueField = DR["ProductCategory_Id"].ToString();
            }
        }

    }
    else if (Request.QueryString["ProductCategory_Id"] != null)
    {
        using (SqlConnection Con = Connection.GetConnection())
        {

            SqlCommand Com = new SqlCommand("GetProducFamilyTP3", Con);
            Com.CommandType = CommandType.StoredProcedure;
            Com.Parameters.Add(Parameter.NewInt("@ProductCategory_Id", Request.QueryString["ProductCategory_Id"]));
            SqlDataReader DR = Com.ExecuteReader();
            if (DR.Read())
            {
                DDlProductFamily.DataTextField = DR["Name"].ToString();
                DDlProductFamily.DataValueField = DR["ProductCategory_Id"].ToString();
            }
        }

    }
</code></pre>

<p>}</p>

<p></p>

<pre><code>                                    &lt;asp:UpdatePanel ID="UpdatePanel3" runat="server"&gt;
                                        &lt;ContentTemplate&gt;
                                            &lt;asp:DropDownList ID="DDlProductFamily" runat="server" 
                                                ondatabound="DDlProductFamily_DataBound" onload="DDlProductFamily_Load" 
                                                onselectedindexchanged="DDlProductFamily_SelectedIndexChanged"&gt;
                                            &lt;/asp:DropDownList&gt;
                                        &lt;/ContentTemplate&gt;
                                        &lt;Triggers&gt;
                                            &lt;asp:AsyncPostBackTrigger ControlID="DDlProductFamily" EventName="SelectedIndexChanged" /&gt;
                                        &lt;/Triggers&gt;
                                    &lt;/asp:UpdatePanel&gt;
</code></pre>
