You must Sign In to post a response.
  • Category: ASP.NET

    Dropdown jquery bind

    hi,
    I am binding my dropdown using jquery from webservice method, now i am placing dropdown inside updatepanel. After selecting value postback happens, then all my dropdown data is empty. Any solutions??


    Regards,
    Naresh.
  • #762658
    Hi,

    If you want the same in all postbacks then keep the dropdown binding inside document.ready function in Jquery. This will load in all times and all postbacks.

    --------------------------------------------------------------------------------
    Give respect to your work, Instead of trying to impress your boss.

    N@veen
    Blog : http://naveens-dotnet.blogspot.in/

  • #762681
    Hai Naresh,
    If postback occurs, the values in the dropdown will get vanished so you need to retains them by loading it again.
    First in the Page_Load, you need to get it bind and then while change event, you need to check why it is getting valished. There might be some event which is making it flush.Do not use JQuery Post method to bund it rather use JQuery Ajax method to call and fill the data. It will do the partial postback and your dropdown will be retained with the original data.
    Below you can check the calling of the service using JQuery and Ajax:

    http://www.codeproject.com/Tips/688228/Bind-Dropdownlist-in-ASP-NET-using-jQuery-AJAX

    Hope it will be helpful to you.

    Regards,
    Pawan Awasthi(DNS MVM)
    +91 8123489140 (whatsApp), +60 14365 1476(Malaysia)
    pawansoftit@gmail.com


Sign In to post your comments