protected void btnOk_Click(object sender, EventArgs e) { if (Page.IsValid) { string pipelineStart = this.txtNewStart.Text.Trim(); string pipelineEnd = this.txtNewEnd.Text.Trim(); string userChild = Request.QueryString["id"]; int count; try { count = Serial.Assign(pipelineStart, pipelineEnd, User.Identity.Name, userChild); } catch (Exception ePipelineExc) { this.lblError.Text = "分配单证号发生错误!"; this.lblError.Text += "<br /><span style='color:gray'>(详情:" + ePipelineExc.Message + ")</span>"; return; } string scriptSucc = this.ClientScriptFactory.PopAlert("成功分配 " + count + " 个单证号!"); this.ClientScript.RegisterClientScriptBlock(GetType(), "", scriptSucc, true); } }