Exemplo n.º 1
0
        protected void DropDownListCountry_SelectedIndexChanged(object sender, EventArgs e)
        {
            DataTable dt;
            Classes.Locations l = new Classes.Locations();
            dt = l.statesList(Convert.ToInt32(DropDownListCountry.SelectedValue));

            List<System.Web.UI.WebControls.ListItem> states = new List<System.Web.UI.WebControls.ListItem>();
            DropDownListState.Items.Clear();
            DropDownListState.Items.Add(new ListItem("Select State", "0"));
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                DropDownListState.Items.Add(new ListItem(dt.Rows[i]["StateName"].ToString(), dt.Rows[i]["StateId"].ToString()));
            }
        }
Exemplo n.º 2
0
        void locationState(int countryId)
        {
            DataTable dt;

            Classes.Locations l = new Classes.Locations();
            dt = l.statesList(countryId);

            List <System.Web.UI.WebControls.ListItem> states = new List <System.Web.UI.WebControls.ListItem>();

            DropDownListState.Items.Clear();
            DropDownListState.Items.Add(new ListItem("Select State", "0"));
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                DropDownListState.Items.Add(new ListItem(dt.Rows[i]["StateName"].ToString(), dt.Rows[i]["StateId"].ToString()));
            }
        }
Exemplo n.º 3
0
        protected void DropDownListCountry_SelectedIndexChanged(object sender, EventArgs e)
        {
            DataTable dt;

            Classes.Locations l = new Classes.Locations();
            dt = l.statesList(Convert.ToInt32(DropDownListCountry.SelectedValue));

            List <System.Web.UI.WebControls.ListItem> states = new List <System.Web.UI.WebControls.ListItem>();

            DropDownListState.Items.Clear();
            DropDownListState.Items.Add(new ListItem("Select State", "0"));
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                DropDownListState.Items.Add(new ListItem(dt.Rows[i]["StateName"].ToString(), dt.Rows[i]["StateId"].ToString()));
            }
        }
Exemplo n.º 4
0
        void locationState(int countryId)
        {
            DataTable dt;
            Classes.Locations l = new Classes.Locations();
            dt = l.statesList(countryId);

            List<System.Web.UI.WebControls.ListItem> states = new List<System.Web.UI.WebControls.ListItem>();
            DropDownListState.Items.Clear();
            DropDownListState.Items.Add(new ListItem("Select State", "0"));
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                DropDownListState.Items.Add(new ListItem(dt.Rows[i]["StateName"].ToString(), dt.Rows[i]["StateId"].ToString()));
            }
        }