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.DobiKraje(); foreach (KeyValuePair <string, int> entry in dictionary) { this.DropDownList1.Items.Insert(0, new ListItem(entry.Key, entry.Value.ToString())); } } }