protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs e) { string stype = e.CommandName; string StaID = e.CommandArgument.ToString(); if (stype == "delete") { if (bll.stuinfodelete(Convert.ToInt32(StaID)) > 0) { Response.Redirect("staffInfo.aspx"); } } else { num = Convert.ToInt32(StaID); StaffModel model = bll.stuinfoupdateID(Convert.ToInt32(StaID)); Label2.Text = model.UserID.ToString(); TextBox2.Text = model.StaName; if (model.StaSex == "男") { RadioButton3.Checked = true; RadioButton4.Checked = false; } else { RadioButton3.Checked = false; RadioButton4.Checked = true; } TextBox3.Text = model.StaPhone; TextBox4.Text = model.StaCard; int iswork = model.IsWork == true ? 1 : 0; foreach (ListItem item in DropDownList3.Items) { if (Convert.ToInt32(item.Value) == iswork) { item.Selected = true; } } } }