private void GetEditData(object p) { sec lst = new sceAccess().Getsec(Int32.Parse(p.ToString())); TextBox1.Text = lst.Name; }
protected void LinkButton1_Click(object sender, EventArgs e) { int id = Convert.ToInt32((sender as LinkButton).CommandArgument); sec lst = new sceAccess().Getsec(id); TextBox1.Text = lst.Name; HiddenField1.Value = id.ToString(); Button1.Visible = false; }
protected void Button2_Click(object sender, EventArgs e) { int id = Int32.Parse(HiddenField1.Value); sec se = new sec(); se.Name = TextBox1.Text; sceAccess manager = new sceAccess(); if (manager.Update(se, id) > 0) { ScriptManager.RegisterStartupScript(this, this.GetType(), "ClientScript", "alert('Succesfully updated')", true); this.GridView1.DataSourceID = SqlDataSource1.ID; } else { ScriptManager.RegisterStartupScript(this, this.GetType(), "ClientScript", "alert('Succesfully updated')", true); } }