Search code examples
jqueryasp.net-mvcumbraco

jquery Load function with multiple values


I have a function I are calling

public ActionResult MemberMaintenance(int MemId)

using jquery I can call this function
$.ajax {
    var MemberId = $('#MemberSelect').val();
$('#MemberDetails').load('@Url.Action("MemberMaintenance", "IBDMembershipFormSurface")' + '?MemId=' + MemberId);
}

This works fine

But now I need to pass additional integers so the function now looks like

public ActionResult MemberMaintenance(int MemId, int NodeID, int GlobalSettingsID)

my jquery now looks like

$.ajax {
    var MemberId = $('#MemberSelect').val();
    var MId = $('#Model.Id').val();
    var GId = $('#globalSettingsId').val();
     $('#MemberDetails').load('@Url.Action("MemberMaintenance", "IBDMembershipFormSurface")' + '?MemId=' + MemberId + '?NodeID=' + MId + '?GlobalSettingsID=' GId);
}

This no action takes place

globalSettingsID is decleated as an int at the start of the html code

Model.Id is the umbraco partial view modal id for the form

I are thinking these are my issue how these are loaded


Solution

  • Solution was remove GId at this point.

    Change var MId to var MId = @Html.Raw(Json.Encode(Model.Id));

    and .load routine to

    $('#MemberDetails').load('@Url.Action("MemberMaintenance", "IBDMembershipFormSurface")' + '?MemId=' + MemberId + '&NodeID=' + MId);