private void OnClick(object sender, EventArgs e) { Button button = (Button)sender; string buttonId = button.ID; string btntxt = button.Text; int idn = Int32.Parse(button.ID); if (btntxt.Equals("Opravi")) { string bri = Baza.OpraviNarocilo(idn); if (bri == "") { Response.Redirect("index.aspx"); } else { this.peter.InnerHtml = bri; } } else { string bri = Baza.BrisiNarocilo(idn); if (bri == "") { Response.Redirect("index.aspx"); } else { this.peter.InnerHtml = bri; } } System.Diagnostics.Debug.WriteLine("Moj id je " + buttonId); }