are you using databinding? if so, do it insideif (!IsPostBack)
{
 //dropdownlist.databind();
}

解决方案 »

  1.   

    我已经使用了“!IsPostBack”语句了!!!
      

  2.   

    show your initialization code + Page_Load..,.
      

  3.   

    private void Page_Load(object sender, System.EventArgs e)
    {
    // 在此处放置用户代码以初始化页面
     // if(Page.IsPostBack)
    // Response.Redirect("index.aspx");
    string sql;
      try
    {
    //新闻信息显示
    sql="select top 4 id,picture,cname,price,preferentialprice from product order by inputdate desc";
    DataSet ds=zddata.dbbind(sql,"product");
    productindex1.DataSource=ds.Tables["product"].DefaultView;
    productindex1.DataBind();
    sql="select top 4 news.id as nid,cname,title,case new     when 1 then '新'    when 0 then '' end as newsstate1,case hot     when 1 then ' 热'     when 0 then ''  end as newsstate2 from news,newscat where news.catid=newscat.id order by pubdate desc";
    ds=zddata.dbbind(sql,"product");
    newsindex1.DataSource=ds.Tables["product"].DefaultView;
    newsindex1.DataBind(); //商品搜索初始化,商品类型使用的是商品的二级分类信息
    sql="select id,cname from productcat";
             ds=zddata.dbbind(sql,"productcat");
    DropListclass.DataSource=ds.Tables["productcat"].DefaultView;
    DropListclass.DataTextField="cname";
    DropListclass.DataValueField="id";
    DropListclass.DataBind();  }
      catch(Exception ex)
      {
      HttpContext.Current.Response.Write(ex.ToString());}private void InitializeComponent()
    {    
       this.searchBut.Click += new System.EventHandler(this.searchBut_Click);
       this.Btn1.ServerClick += new System.EventHandler(this.Btn1_ServerClick);
       this.Btn2.ServerClick += new System.EventHandler(this.Btn2_ServerClick);
       this.Load += new System.EventHandler(this.Page_Load);}
      

  4.   

    private void Page_Load(object sender, System.EventArgs e)
    {
        if (!IsPostBack)
        {
    string sql;
      try
    {
    //新闻信息显示
    sql="select top 4 id,picture,cname,price,preferentialprice from product order by inputdate desc";
    DataSet ds=zddata.dbbind(sql,"product");
    productindex1.DataSource=ds.Tables["product"].DefaultView;
    productindex1.DataBind();
    sql="select top 4 news.id as nid,cname,title,case new     when 1 then '新'    when 0 then '' end as newsstate1,case hot     when 1 then ' 热'     when 0 then ''  end as newsstate2 from news,newscat where news.catid=newscat.id order by pubdate desc";
    ds=zddata.dbbind(sql,"product");
    newsindex1.DataSource=ds.Tables["product"].DefaultView;
    newsindex1.DataBind(); //商品搜索初始化,商品类型使用的是商品的二级分类信息
    sql="select id,cname from productcat";
             ds=zddata.dbbind(sql,"productcat");
    DropListclass.DataSource=ds.Tables["productcat"].DefaultView;
    DropListclass.DataTextField="cname";
    DropListclass.DataValueField="id";
    DropListclass.DataBind();       }
           catch(Exception ex)
           {
       HttpContext.Current.Response.Write(ex.ToString());
           }
       }
    }
      

  5.   

    谢谢!!saucer(思归/MVP) 大虾!!
    搞定!!收工!!