protected void Page_Load(object sender, EventArgs e) { int id = Convert.ToInt32(Page.RouteData.Values["id"]); NewManager nm = new NewManager(); edit1 = nm.GetByID(id); }
protected void Page_Load(object sender, EventArgs e) { try { int id = Convert.ToInt32(Request["id"]); NewManager cm = new NewManager(); delete = cm.GetByID(id); delete.NewsStatus = -1; cm.Save(); Response.Write(1); } catch (Exception ex) { Response.Write(ex); } }
protected void Page_Load(object sender, EventArgs e) { try { int id = Convert.ToInt32(Request["id"]); string name = Request["name"]; string content = Request["description"]; NewManager NM = new NewManager(); edit = NM.GetByID(id); edit.NewsName = name; edit.NewsContent = content; NM.Save(); Response.Write(1); } catch (Exception ex) { Response.Write(ex); } }