jQuery Ajax call to controller

前端 未结 2 1969
一个人的身影
一个人的身影 2020-12-07 02:37

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

2条回答
  •  萌比男神i
    2020-12-07 03:04

    Set data in the Ajax call so that its key matches the parameter on the controller (that is, Id):

    data: { Id: mlaId },
    

    Note also that it's a better practice to use @Url.Action(actionName, controllerName) to get an Action URL:

    url: '@Url.Action("GetMlaDeliveryType", "Recipients")'
    

提交回复
热议问题