protected void _btnDeleteMovie_Click(object sender, EventArgs e) { System.Web.UI.WebControls.Button btn = (System.Web.UI.WebControls.Button)sender; string IdMovieToDelete = btn.Attributes["Value"]; int id; Int32.TryParse(IdMovieToDelete, out id); context.DeleteMovie(id); Response.Redirect("~/Default.aspx"); }
protected void _btnDeleteMovie_Click(object sender, EventArgs e) { Button btn = (Button)sender; string IdMovieToDelete = btn.Attributes["Value"]; int id; Int32.TryParse(IdMovieToDelete, out id); context.DeleteMovie(id); Response.Redirect("~/Pages/Movies.aspx"); }