protected void ctlUserGrid_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "UserEdit") { int rowIndex = ((GridViewRow)((ImageButton)e.CommandSource).NamingContainer).RowIndex; long userId = UIHelper.ParseLong(ctlUserGrid.DataKeys[rowIndex].Value.ToString()); IList <SuUser> userList = new List <SuUser>(); SuUser user = SuUserService.FindByIdentity(userId); userList.Add(user); ctlUserForm.DataSource = userList; ctlUserForm.PageIndex = 0; ctlUserForm.ChangeMode(FormViewMode.Edit); ctlUserForm.DataBind(); UpdatePanelUserForm.Update(); ctlUserModalPopupExtender.Show(); } }
protected void ctlAddNew_Click(object sender, ImageClickEventArgs e) { ctlUserModalPopupExtender.Show(); UpdatePanelUserForm.Update(); ctlUserForm.ChangeMode(FormViewMode.Insert); }