protected void Page_Load(object sender, EventArgs e) { try { if (!IsPostBack) { Butonvisible(true); panelVisible(false, true, false, false); List <string> languageList = (from l in db.Language where l.IsActive == true select l.LanguageName).ToList(); ddlLanguage.DataSource = languageList; ddlLanguage.DataBind(); ddlFilterLanguage.DataSource = languageList; ddlFilterLanguage.DataBind(); ddlFilterLanguage.Items.Insert(0, new ListItem("Dil Seçiniz..", "0")); ddlFilterLanguage.SelectedIndex = 0; } SliderList.DataSource = (from s in db.Slider select s).ToList(); SliderList.DataBind(); ((Master)this.Master).Path = "Slider"; ((Master)this.Master).PathLink = "SliderPage.aspx"; } catch (Exception) { Uyari("Bir Hata Oluştu!", false); pnlAlert.Visible = true; } }
protected void ddlFilterLanguage_SelectedIndexChanged(object sender, EventArgs e) { try { string languageValue = ddlFilterLanguage.SelectedValue; if (languageValue != "0") { Language language = (from l in db.Language where l.LanguageName == languageValue select l).FirstOrDefault(); SliderList.DataSource = (from s in db.Slider where s.LanguageID == language.ID select s).ToList(); SliderList.DataBind(); } else { SliderList.DataSource = (from s in db.Slider select s).ToList(); SliderList.DataBind(); } } catch (Exception) { Uyari("Bir Hata Oluştu!", false); pnlAlert.Visible = true; } }