Ejemplo n.º 1
0
        private void BindControls()
        {
            Country countries = new Country();
            countries.LoadAll();
            uiDropDownListCountry.DataSource = countries.DefaultView;
            uiDropDownListCountry.DataTextField = Country.ColumnNames.CountryName;
            uiDropDownListCountry.DataValueField = Country.ColumnNames.CountryID;
            uiDropDownListCountry.DataBind();
            uiDropDownListCountry.Items.Insert(0, new ListItem("Select country", "0"));

            Gender gender = new Gender();
            gender.LoadAll();
            uiRadioButtonListGender.DataSource = gender.DefaultView;
            uiRadioButtonListGender.DataTextField = Gender.ColumnNames.GenderType;
            uiRadioButtonListGender.DataValueField = Gender.ColumnNames.GenderID;
            uiRadioButtonListGender.DataBind();
            uiRadioButtonListGender.SelectedIndex = 0;
        }
Ejemplo n.º 2
0
        private void LoadDDls()
        {
            Country countries = new Country();
            countries.LoadAll();
            uiDropDownListAddressCountry.DataSource = countries.DefaultView;
            uiDropDownListAddressCountry.DataTextField = Country.ColumnNames.CountryName;
            uiDropDownListAddressCountry.DataValueField = Country.ColumnNames.CountryID;
            uiDropDownListAddressCountry.DataBind();
            uiDropDownListAddressCountry.Items.Insert(0, new ListItem("Select ....", "0"));

            uiDropDownListCOI.DataSource = countries.DefaultView;
            uiDropDownListCOI.DataTextField = Country.ColumnNames.CountryName;
            uiDropDownListCOI.DataValueField = Country.ColumnNames.CountryID;
            uiDropDownListCOI.DataBind();
            uiDropDownListCOI.Items.Insert(0, new ListItem("Select ....", "0"));

            uiDropDownListCountry.DataSource = countries.DefaultView;
            uiDropDownListCountry.DataTextField = Country.ColumnNames.CountryName;
            uiDropDownListCountry.DataValueField = Country.ColumnNames.CountryID;
            uiDropDownListCountry.DataBind();
            uiDropDownListCountry.Items.Insert(0, new ListItem("Select ....", "0"));

            uiDropDownListPOB.DataSource = countries.DefaultView;
            uiDropDownListPOB.DataTextField = Country.ColumnNames.CountryName;
            uiDropDownListPOB.DataValueField = Country.ColumnNames.CountryID;
            uiDropDownListPOB.DataBind();
            uiDropDownListPOB.Items.Insert(0, new ListItem("Select ....", "0"));

            CourseLangauge langs = new CourseLangauge();
            langs.LoadAll();
            uiDropDownListLanguage.DataSource = langs.DefaultView;
            uiDropDownListLanguage.DataTextField = CourseLangauge.ColumnNames.Langauge;
            uiDropDownListLanguage.DataValueField = CourseLangauge.ColumnNames.CourseLangaugeID;
            uiDropDownListLanguage.DataBind();
            uiDropDownListLanguage.Items.Insert(0, new ListItem("Select ....", "0"));

            Gender genders = new Gender();
            genders.LoadAll();
            uiRadioButtonListGender.DataSource = genders.DefaultView;
            uiRadioButtonListGender.DataTextField = Gender.ColumnNames.GenderType;
            uiRadioButtonListGender.DataValueField = Gender.ColumnNames.GenderID;
            uiRadioButtonListGender.DataBind();
            uiRadioButtonListGender.SelectedIndex = 0;
        }