Dropdown gets cleared

后端 未结 5 1058
南笙
南笙 2021-01-29 04:16

I have one asp.net application, in which i have one dropdown which is binded to dataset. But after selecting one item, the drop down gets cleared all the value, How we can resol

5条回答
  •  广开言路
    2021-01-29 04:47

    From your question if I understand correctly you dont want the dropdown list to rebind if it is populated. Also please check your viewstate, this should not be happening, unless you have disabled viewstate

     protected void Page_Load(object sender, EventArgs e)
    {        
      if (!IsPostBack && ddlProduct.Items.count <=0 )
            BindProductDdl();
    

    }

提交回复
热议问题