如果你在Page_Load事件中给Dp绑定,那么将绑定的代码写在if(!IsPostBack){}中

解决方案 »

  1.   

    同意戏子
    绑定代码放到
    if not ispostback then
    end if
      

  2.   

    if not ispostback then
        dropdownlist.datasource=SqlDataReader
        dropdownlist.DataTextField = "Col1"
        dropdownlist.DataValueField = "Col2"
        DataBind()
    end if
      

  3.   

    dropdownlist.datasource=SqlDataReader
    dropdownlist.DataTextField = "Col1"
    dropdownlist.DataValueField = "Col2"
    DataBind()你的这句话一定写在Page_Load中了,每次页面刷新他都会执行一次,所以每次都选择第一项所以要这样写,保证只在页面第一次装入时才执行
    if(!IsPostBack)
    {
    dropdownlist.datasource=SqlDataReader
    dropdownlist.DataTextField = "Col1"
    dropdownlist.DataValueField = "Col2"
    DataBind()
    }