ASP.Net DropDownList OnSelectedIndexChange not firing

前端 未结 4 1629
星月不相逢
星月不相逢 2021-01-18 03:33

I have the following DropDownList control:




        
相关标签:
4条回答
  • 2021-01-18 04:11

    AutoPostBack="true" and

    write page load event

    if (!IsPostBack)
    {
       DDL_Designation_Bind();   
    }
    

    // Because autopostback properties fire load event then our dropdownlist rebind and always selected index 0 so Not Rebinding dropDownlist

    0 讨论(0)
  • 2021-01-18 04:26

    Add this to dropdown list aspx it will cause a request to be send to the server and your event will be fired.

    AutoPostBack="true"
    
    0 讨论(0)
  • 2021-01-18 04:28

    Set AutoPostBack=True as an attribute of your DDL and it will automatically post back the selected index change event

    0 讨论(0)
  • 2021-01-18 04:31

    You just need to set AutoPostBack = True

    From ListControl.AutoPostBack property;

    Gets or sets a value indicating whether a postback to the server automatically occurs when the user changes the list selection.

    0 讨论(0)
提交回复
热议问题