예제 #1
0
        protected void BindTimeZone(string MyCountry)
        {
            //Create blank list
            List <RentALanguageTeacher.App_Code.Time.TimeZoneDDL> list = new List <RentALanguageTeacher.App_Code.Time.TimeZoneDDL>();

            //Populate List from country
            list = TimeService.FillTimeZoneDDL(MyCountry);

            //Create Default
            RentALanguageTeacher.App_Code.Time.TimeZoneDDL DefaultCountry = new RentALanguageTeacher.App_Code.Time.TimeZoneDDL();

            DefaultCountry.ZoneId   = 0;
            DefaultCountry.ZoneName = "Select your TimeZone";

            list.Add(DefaultCountry);

            //Bind DDL
            TimeZone.DataSource     = list;
            TimeZone.DataValueField = "ZoneId";
            TimeZone.DataTextField  = "ZoneName";
            TimeZone.DataBind();

            //Select Default Value
            TimeZone.SelectedValue = "0";

            //Enable
            TimeZone.Enabled = true;
        }