protected void Page_Load(object sender, EventArgs e) { if (Session["stanje"] != null) { if ((int)Session["stanje"] > 1) { Response.Redirect("index.aspx"); } } else { Response.Redirect("index.aspx"); } if (!IsPostBack) { Dictionary <string, int> dictionary = new Dictionary <string, int>(); dictionary = Baza.DobiZnamke(); foreach (KeyValuePair <string, int> entry in dictionary) { this.DropDownList3.Items.Insert(0, new ListItem(entry.Key, entry.Value.ToString())); } dictionary = new Dictionary <string, int>(); int idzn = Int32.Parse(this.DropDownList3.SelectedValue); dictionary = Baza.DobiModele(idzn); foreach (KeyValuePair <string, int> entry in dictionary) { this.DropDownList2.Items.Insert(0, new ListItem(entry.Key, entry.Value.ToString())); } } }
protected void Page_Load(object sender, EventArgs e) { if (Session["uporabnik"] == null || Session["stanje"] == null) { Response.Redirect("index.aspx"); } else if ((int)Session["stanje"] != 3) { Response.Redirect("index.aspx"); } if (!IsPostBack) { Dictionary <string, int> dictionary = new Dictionary <string, int>(); dictionary = Baza.DobiZnamke(); foreach (KeyValuePair <string, int> entry in dictionary) { this.DropDownList1.Items.Insert(0, new ListItem(entry.Key, entry.Value.ToString())); } } }