//修改事件 public void SubmitUpd(string ID) { string strTime = System.DateTime.Now.ToString(); bool success = false; if (!FileUpload1.HasFile)//是否需要上传图片 { success = newshelper.NewsUpdate(ID, DropGroup.SelectedItem.Value, txtTlitle.Text.Trim(), content1.InnerText, txtFromWhere.Text.Trim(), RadioState.SelectedItem.Value, strTime); } else { DeletePhoto(ID);//删除原有图片 UploadPhoto();//上传图片 success = newshelper.NewsUpdate(ID, DropGroup.SelectedItem.Value, txtTlitle.Text.Trim(), hid.Value, content1.InnerText, txtFromWhere.Text.Trim(), RadioState.SelectedItem.Value, strTime); } if (success) { ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('修改完成!')</script>"); Response.Redirect("NewsMain.aspx?ceid=" + Request.QueryString["ceid"].ToString()); } else { ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('修改失败!')</script>"); } }