当前位置:编程学习 > C#/ASP.NET >>

网页打开一段时间,点击保存按钮,出现网页无法显示

一个表单,输入内容后,直接保存,ok没问题。但是你要是过个五分钟再保存,不行了就,直接出现无法显示该网页,各位亲们,有什么好的意见没,很急 --------------------编程问答-------------------- 有没有查看是什么原因引起的呢?是不是session等一些过期了,导致用户权限没有了 --------------------编程问答-------------------- 是不是session等过期了,导致用户没有页面权限了 --------------------编程问答-------------------- 不是session的问题,就一个保存按钮,onclick事件,调用后台的方法保存 --------------------编程问答-------------------- LZ啊 代码贴一下,错误信息贴一下啊 说的这么抽象 怎么解决 --------------------编程问答--------------------  前台:<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
                                <ContentTemplate>
                                       
                                
                                </ContentTemplate>
                                </asp:UpdatePanel>
                                <asp:Button ID="btnAdd" runat="server" Text="保存" CssClass="FlatButton" 
                                        OnClick="btnAdd_Click" UseSubmitBehavior="False" />
                                <input id="btnClose" type="button" value="关闭" class="FlatButton" onclick="javascript:window.close()" />
本来是放在updatepanel里面的,那样会出现过一段时间,按钮失效 --------------------编程问答-------------------- 后台:protected void btnAdd_Click(object sender, EventArgs e)
    {
        ResearchPapersInfo info = new ResearchPapersInfo();
        info.Rese_ID = Guid.NewGuid().ToString();
        info.Rese_Currency = this.ddlCurrType.SelectedValue == "0" ? "" : this.ddlCurrType.SelectedValue;

      //  info.Rese_Department = txtDeptName.Text.Trim();

        /****************科室ID************************/
        string deptID = new DeptTool().GetDeptIDByName(txtDeptName.Text.Trim());
        if (!string.IsNullOrEmpty(deptID))
        {
            info.Rese_Department = deptID;
        }
        else
        {
            ScriptManager.RegisterClientScriptBlock(UpdatePanel1, this.GetType(), "key", "alert('输入的科室无效!');", true);
            return;
        }
        /*****************************************/

        info.Rese_Effection = double.Parse(this.txtAffectGene.Text == "" ? "0" : this.txtAffectGene.Text);
        if (txtBookFee.Text != "")
        info.Rese_BookFee = double.Parse(this.txtBookFee.Text);
        info.Rese_FirstAuthor = this.txtFirAuthor.Text.Trim().Replace(";", " ");
        info.Rese_FirstAuthorDept = this.txtFirAuthorDept.Text;
        
        info.Rese_IssueNo = this.txtIssue.Text;
        info.Rese_Number = this.lblNumber.Text;//自增:年+0001
        info.Rese_Organization = this.ddlOrganization.SelectedValue == "0" ? "" : this.ddlOrganization.SelectedValue;
        info.Rese_Publication = this.txtName.Text.Trim();//刊名
        info.Rese_Remark = this.txtRemark.Text;
        info.Rese_ResponsibleAuthor = this.txtDutyAuthor.Text.Trim().Replace(";", " ");
        info.Rese_ResponsibleAuthorDept = this.txtDutyAuthorDept.Text;

        info.Rese_Roll = this.txtBookNumber.Text;
        info.Rese_SecondAuthor = this.txtSecAuthor.Text;
        info.Rese_SecondAuthorDept = this.txtSecAuthorDept.Text;

        info.Rese_ThirdAuthor = this.txtThirdAuthor.Text;
        info.Rese_ThirdAuthorDept = this.txtThirdAuthorDept.Text;

        info.Rese_Title = this.txtTitle.Text;
        info.Rese_Type = this.ddlType.SelectedValue == "0" ? "" : this.ddlType.SelectedValue;
        info.Rese_YearNumber = DropDownList1.SelectedItem.Value; // this.ddlYearNumber.SelectedValue == "0" ? "" : this.ddlYearNumber.SelectedValue;
        info.Rese_LogScore = this.ddlLogScore.SelectedValue == "0" ? "" : this.ddlLogScore.SelectedValue;
        info.Rese_LogScoreYear = this.ddlLogScoreYear.SelectedValue == "0" ? int.Parse(DateTime.Now.Year.ToString()) : int.Parse(this.ddlLogScoreYear.SelectedValue);


        if(!string.IsNullOrEmpty(this.txtFirAuthor.Text))
            info.Rese_FirstAuthorUnit = this.txtFirAuthorUnit.Text;
        else
            info.Rese_FirstAuthorUnit = "";

        if (!string.IsNullOrEmpty(this.txtSecAuthor.Text))
            info.Rese_SecondAuthorUnit = this.txtSecAuthorUnit.Text;
        else
            info.Rese_SecondAuthorUnit = "";

        if (!string.IsNullOrEmpty(this.txtThirdAuthor.Text))
            info.Rese_ThirdAuthorUnit = this.txtThirdAuthorUnit.Text;
        else
            info.Rese_ThirdAuthorUnit = "";

        if (!string.IsNullOrEmpty(this.txtDutyAuthor.Text))
            info.Rese_ResponsibleAuthorUnit = this.txtDutyAuthorUnit.Text;
        else
            info.Rese_ResponsibleAuthorUnit = "";

        if (ddlOrganization.SelectedValue.ToUpper() == "SCI")
        {
            if (ddlStateRecord.SelectedValue != "0")
            {
                info.Rese_StateRecord = ddlStateRecord.SelectedValue.ToString();
            }
        }
        else
        {
            info.Rese_StateRecord = "";
        }

        info.Rese_SameFirstAuthor = ""; //备注:20101229 添加此字段作为"并列第一作者",后弃用.
        info.Rese_SameResponsibleAuthor = "";//同上。

        ResearchPapersTool tool = new ResearchPapersTool();

        #region 刊名拼音码 by kathy 2009-11-24
        
        DataSet ds = tool.GetResearchPapersBySql("select * from PublicationName where Pub_Name='" + info.Rese_Publication + "'");
        
        if (ds == null || ds.Tables.Count <= 0 || ds.Tables[0].Rows.Count <= 0)
        {
            // add
            string en = new Common().ConvertChineseWord(info.Rese_Publication);
            tool.GetResearchPapersBySql("insert into PublicationName(Pub_Name, Pub_EN) values('" + info.Rese_Publication + "', '" + en + "')");
        }

        #endregion

        ////插入到数据库中之前,重新取出最大编号
        //string maxNumber = tool.ReturnMaxNumber();
        //info.Rese_Number = lblNumber.Text;
        
        string value = string.Empty;
        if (new ResearchPapersTool().AddResearchPapers(info))
        {
            //添加操作日志
            OperateLogTool logTool = new OperateLogTool();
            OperateLogInfo logInfo = logTool.GetLogInfo();

            if (logInfo != null)
            {
                logInfo.Oper_Name = "添加科研论文";
                logInfo.Oper_Data = "项目名称:" + info.Rese_Title + " / 科室:" + info.Rese_Department + " / 第一作者:" + info.Rese_FirstAuthor + " / 并列第一作者:" + info.Rese_SameFirstAuthor;
                logTool.AddOperation(logInfo);
            }
            //value = "alert('保存成功!');window.location.href='ScienceThesisAdd.aspx';";
            value = "alert('保存成功!');window.opener.location.href=window.opener.location.href;window.close();";
            //Response.Redirect("ScienceThesisAdd.aspx");
        }
        else
            value = "alert('保存失败!');";

         
        ScriptManager.RegisterClientScriptBlock(UpdatePanel1, this.GetType(), "key", value, true);

    } --------------------编程问答-------------------- --------------------编程问答-------------------- 这个问题我遇到过类似的,但是不是你这个问题 --------------------编程问答--------------------
引用 8 楼  的回复:
这个问题我遇到过类似的,但是不是你这个问题

你的是什么问题,可以说一下吗,我看看是不是有用,谢谢 --------------------编程问答-------------------- LZ我回复up 居然不让 我凑 只能回复upupupupupupupup --------------------编程问答-------------------- 我也遇到了,顶上去,快来人帮忙解决呀。
补充:.NET技术 ,  ASP.NET
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,