コード例 #1
0
    protected void ddlcountry_SelectedIndexChanged(object sender, EventArgs e)
    {
        ddlstewardshiptype.Items.Clear();
        if (ddlcountry.SelectedValue != "0")
        {
            DataSet ds = OrganizationInfo.GetStewardshipByCountryID(Convert.ToInt32(ddlcountry.SelectedValue));

            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    ListItem item = new ListItem();
                    item.Value = dr["OrganizationId"].ToString();
                    item.Text  = dr["StateName"].ToString();
                    ddlstewardshiptype.Items.Add(item);
                }
            }
        }
        ddlstewardshiptype.Items.Insert(0, new ListItem(ResourceMgr.GetMessage("Select"), "0"));
    }