JavaScript GetDropDownData function
Oct 26, 2020 09:26 0 Comments Javascript ANANYA

 

function GetDropDownData() {

    // Get the DropDownList.

    var ddlTestDropDownListXML = $('#ddlTestDropDownListXML');

     

    // Provide Some Table name to pass to the WebMethod as a paramter.

    var tableName = "someTable + OptionText + "");

        option.attr("value", OptionValue);

    $.ajax({

        type: "POST",

        url: "BindDropDownList.aspx/GetDropDownItems",ddlTestDropDownListXML.append(option)

); 

      data: '{tableName: "' + tableName + '"}',

  },

        contentType: "application/json; charset=utf-8",

failure: function (response)

{

 alert(response.d);

 }

 

  });

}

dataType: "json",

        success: function (response) {

            // Now find the Table from response and loop through each item (row).

            $(response.d).find(tableName).each(function () {

                // Get the OptionValue and OptionText Column values.

                var OptionValue = $(this).find('OptionValue').text();

                var OptionText = $(this).find('OptionText').text();

                 

                // Create an Option for DropDownList.

                var option = $("

 

                

 

                ;

           

      

        

           

        

Prev Next
About the Author
Topic Replies (0)
Leave a Reply
Guest User

You might also like

Not sure what course is right for you?

Choose the right course for you.
Get the help of our experts and find a course that best suits your needs.


Let`s Connect