title: jQuery Ajax call to controller
body: <p>I'm new to Ajax and I'm trying to disable a checkbox if certain items are selected in a dropdown.  I need to pass in the mlaId to the GetMlaDeliveryType(int Id) method in the RecipientsController.cs.</p>
  
  <p>I'm not exactly sure how to set  up the ajax call in the javascript function checkMlaDeliveryType(mlaId).</p>
  
  <pre><code>        //  MLA Add  disable express checkbox if delivery type is electronic
          $('.AddSelectedMla').change(function () {
  
              var deliveryType = checkMlaDeliveryType($('.AddSelectedMla').val());
  
  
              // disable express option if delivery type is Electronic
              if (deliveryType == "Mail") {
                  $(".mlaExpressIndicator").removeAttr("disabled");
              }else{
                  $(".mlaExpressIndicator").attr('checked', false).attr("disabled", true);
              }
  
          })
  
          // ajax call to get delivery type - "Mail" or "Electronic"
          function checkMlaDeliveryType(mlaId)
          {
              $.ajax({
                  type: "GET",
                  url: "/Recipients/GetMlaDeliveryType/" ,
                  data: mlaId,
                  dataType: ,
                  success: 
              });
  
          }
  
  RecipientsController.cs
  
      public string GetMlaDeliveryType(int Id) 
      {
          var recipientOrchestrator = new RecipientsOrchestrator();
  
          // Returns string "Electronic" or "Mail"
          return recipientOrchestrator.GetMlaDeliveryTypeById(Id);
      }
  </code></pre>
  
  <p>EDIT:</p>
  
  <p>Here's how the final javascript looked that worked</p>
  
  <pre><code>//  MLA Add  disable express checkbox if delivery type is electronic
  $('.AddSelectedMla').change(function () {
  
      checkMlaDeliveryType($('.AddSelectedMla').val());
  })
  
  // ajax call to get delivery type - "Mail" or "Electronic"
  function checkMlaDeliveryType(mlaId)
  {
      $.ajax({
          type: 'GET',
          url: '@Url.Action("GetMlaDeliveryType", "Recipients")',
          data: { id: mlaId },
          cache: false,
          success: function (result) {
              // disable express option if delivery type is Electronic
              if (result == "Mail") {
                  $(".mlaExpressIndicator").removeAttr("disabled");
              } else {
                  $(".mlaExpressIndicator").attr('checked', false).attr("disabled", true);
              }
          }
      });
  
  }
  </code></pre>