/// <summary> /// 保存事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Button1_Click(object sender, EventArgs e) { if (id == 6 || id == 7) { AboutMenu item = AboutMenuService.GetModel(id); if (item != null) { item.proValue = content1.Value; AboutMenuService.Update(item); } } else { AboutMenuService.SetValue(id, content1.Value); } ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "", "alert('保存成功!');", true); }
/// <summary> /// 控件行命令事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void repInfo_ItemCommand(object source, RepeaterCommandEventArgs e) { if (e.CommandName.Equals("del")) { int id = Convert.ToInt32(e.CommandArgument); AboutMenuService.Delete(id); } if (e.CommandName.Equals("mod")) { int id = Convert.ToInt32(e.CommandArgument); AboutMenu item = AboutMenuService.GetModel(id); if (item != null) { ; txtLinkName.Text = item.proName; txtTitle.Text = item.remark; lblId.Text = item.id.ToString(); content1.Value = item.proValue; pnlAdd.Visible = true; pnlList.Visible = false; } } sp.InitBindData(repInfo, pager1, "AboutMenu", "id", sear()); }