protected void uiGridViewContacts_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "EditContact") { DBLayer db = new DBLayer(); CurrentContact = Convert.ToInt32(e.CommandArgument); DataSet ds = db.GetContactContent(CurrentContact); uiTextBoxTitle.Text = ds.Tables[0].Rows[0]["Title"].ToString(); uiTextBoxLatitude.Text = ds.Tables[0].Rows[0]["Latitude"].ToString(); uiTextBoxLongitude.Text = ds.Tables[0].Rows[0]["Longitude"].ToString(); uiTextBoxContent.Text = Server.HtmlDecode(ds.Tables[0].Rows[0]["Content"].ToString()); uiTextBoxMail.Text = ds.Tables[0].Rows[0]["email"].ToString(); uiPanelViewContact.Visible = false; uiPanelEdit.Visible = true; } else if (e.CommandName == "DeleteContact") { DBLayer db = new DBLayer(); db.DeleteContact(Convert.ToInt32(e.CommandArgument)); CurrentContact = 0; BindData(); } }