DropDownList1.EnableViewState是不是为true?

解决方案 »

  1.   

    if (DropDownList1.SelectedItem.Value.ToString()!="--请选择--")
    换成if (DropDownList1.SelectedValue.ToString()!="--请选择--")试试
      

  2.   

    检查page_load是否用了IsPostBack!用了的话去掉它
      

  3.   

    现象:
    选择列表框DropDownList1:河北省网页刷新显示‘--请选择--‘为什么
      

  4.   

    不好意思,上面说的不明确,应是如果你把填充ddl1和ddl2的语句放在了ispostback里,建议拿出来来试试。设断点调试一下应该能解决的。
      

  5.   

    现象:
    选择列表框DropDownList1:河北省网页刷新显示‘--请选择--‘为什么
    这个原因有可能是你只是在初始化页面时才执行Fill ddl1和ddl2操作,而页面刷新的时候你没有再查找数据库进行填充ddl1和ddl2,所以只显示“请选择”,具体情况,请设断点进行调试
      

  6.   

    我只是在ispostback中fill DropDownList1  DropDownList1  的electedIndexChanged中fill DropDownList2
      

  7.   

    把fill dropdownlist1拿到ispostback外面