0

I'm trying to take a value from a drop down list and pass the selected value as parameters in an AJAX page method call via jquery. How do I reference the control's selected value in the data: parameter segment of the call? Do I just reference it by it's ID? Here's what I've got:

    $(document).ready(function()
{
    $("#AssignEmployeeButton").click(function()
    {
        $.ajax(
        {
            type: "POST",
            url: "TeamManager.aspx/IsOnlyTeamEmployee",
            data: "{'employeeId': *control value here*}",
            contentType: "application/json; charset=utf-8",
            success: function(msg)
            {
                //function body will go here
            }
        }
    }
}
Chris V.
  • 1,123
  • 5
  • 22
  • 50

1 Answers1

1
$.ajax({
    data: "{'employeeId': $('#idOfYourDDL').val()}"
});
Brad M
  • 7,857
  • 1
  • 23
  • 40