protected void Submit1_ServerClick(object sender, EventArgs e) { AdvInfo ob = new AdvInfo(); ob.title = tbtitle.Text; ob.imgurl = tbimgUrl.Text; ob.imglink = tbimgLink.Text; ob.flyimagewidth = int.Parse(tbFlyImageWidth.Text); ob.flyimageheight = int.Parse(tbFlyImageHeight.Text); ob.addtime = Convert.ToDateTime(tbAddTime.Text); ob.flag = this.rbFlag.SelectedValue == "1" ? true : false; AdvInfoService.InsertAdvInfo(ob); try { string script = "<script>if(confirm('是否继续添加?')){location='" + Request.Url.ToString() + "';}else{location='advInfo_add.aspx';}</script>"; Response.Write(script); Response.End(); } catch { ShowJs.ShowAndRedirect("添加失败!", "advInfo_add.aspx", this.Page); } }