Page_Load中加
if(!IsPostBack)
{
listbox数据绑定;
}

解决方案 »

  1.   

    不会吧,绑定是否放在!IsPostBack中呢
      

  2.   

    你是不是选择了autopostback,如果选择了,重新绑定的话肯定跳到第一项啦
      

  3.   

    private void Page_Load(object sender, System.EventArgs e)
    {
    if(!IsPostBack)
    {
    InitList();
    }
    }
    private void InitList()
    {
    this.lstList.Items.Clear();
    SqlConnection myConn=new SqlConnection(myConnStr);
    string myCmdStr="Select * from user order by name";
    SqlCommand myCmd=new SqlCommand(myCmdStr,myConn);
    SqlDataAdapter myAdapter=new SqlDataAdapter(myCmd);
    DataSet myDS=new DataSet();
    myAdapter.Fill(myDS,"User");
    this.lstList.DataSource=myDS;
    this.lstList.DataMember="manufactory";
    this.lstList.DataTextField="name";
    this.lstList.DataValueField="url";
    this.lstList.DataBind();
    }
      

  4.   

    autopostback加不加都一样,只有在只绑定text是listbox操作正常
      

  5.   

    将初始化代码放在
    !IsPostBack中
      

  6.   

    value和text是关联的,所以只能绑一个
      

  7.   

    这可能是一个bug,昨晚我用新版的.NET试了一下,没有这个问题,如果再没有人有好的解决方案我就结贴了!