b页面代码如下:using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using ssc.businessRules;
using ssc.dataAccess;
using ssc.webControls;
using System.Data.SqlClient;
using System.Configuration;
using System.Data.Common;namespace ssc.webUI
{
/// <summary>
/// EvaluationUpdate 的摘要说明。
/// </summary>
public class EvaluationUpdate : System.Web.UI.Page
{
protected System.Web.UI.WebControls.TextBox TextBox1;
protected System.Web.UI.WebControls.Button Button1;
protected System.Web.UI.WebControls.Button Button2;
ssc.buRules.Company cp; private string evaluation = String.Empty;
private void Page_Load(object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面 ViewState["com_id"] = this.Request.QueryString["com_id"];
www=ViewState["com_id"].ToString();
cp = new ssc.buRules.Company();
ds = new ssc.buRules.CompanyInfoData().GetCompanyInfoDS(www);
//Fill();
if(!this.Page.IsPostBack)
{
Fill();
}
} #region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN:该调用是 ASP.NET Web 窗体设计器所必需的。
//
InitializeComponent();
base.OnInit(e);
}

/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{    
this.Button1.Click += new System.EventHandler(this.Button1_Click);
this.Button2.Click += new System.EventHandler(this.Button2_Click);
this.Load += new System.EventHandler(this.Page_Load); }
#endregion private void Fill()
{
}
public void Button1_Click(object sender, System.EventArgs e)
{//更新事件
bool flag = false; if (this.Page.IsValid)
{
flag = cp.UpEvaluation(ViewState["com_id"].ToString(),TextBox1.Text); }
if (flag)
{
if(!Page.IsClientScriptBlockRegistered("clientScript"))
Page.RegisterStartupScript("clientScript", "<script language='javascript'> alert('绩效评价提交成功!');window.returnValue=1;window.close();</script>");
}
else
{
if(!Page.IsClientScriptBlockRegistered("clientScript"))
Page.RegisterStartupScript("clientScript", "<script language='javascript'> alert('绩效评价提交成功!');window.returnValue=0;window.close();</script>");
}

} public void Button2_Click(object sender, System.EventArgs e)
{//置空事件
TextBox1.Text="";
}
}
}

解决方案 »

  1.   

    if not ispostback then
        '**********
    end if
      

  2.   

    private void Page_Load(object sender, System.EventArgs e)
    {
    // 在此处放置用户代码以初始化页面
    if(!Page.IsPostBack)
    {
    ViewState["com_id"] = this.Request.QueryString["com_id"];
    www=ViewState["com_id"].ToString();
    cp = new ssc.buRules.Company();
    ds = new ssc.buRules.CompanyInfoData().GetCompanyInfoDS(www);
    //Fill();
    if(!this.Page.IsPostBack)
    {
    Fill();
    }}
    }
      

  3.   

    if(!this.Page.IsPostBack)
    {
    Fill();
    }
    这句就不要了!!
      

  4.   

    http://expert.csdn.net/Expert/topic/1501/1501428.xml?temp=.2998468
      

  5.   

    最简单的方法:在 page_load事件里加入一个判断,
    bool loaded=false;
    page_load(.....)
    {
      if(!this.Page.IsPostBack)
      {
        if(!loaded)
            Fill();
            loaded=true;
      }
      

  6.   

    if(!this.Page.IsPostBack)这句最有效,加上就好了,还是走两遍,但检测了!