Ich arbeite an Asp. NET-Mvc-Projekt mit Rasierer.Access-Modell in Javascript asp. NET mvc Rasierer
Ich versuche, mein Modell in Javascript zuzugreifen, als
alert(Model.SecurityProfile); alert(model.SecurityProfile); alert(@Model.SecurityProfile); alert(@model.SecurityProfile);var SecurityProfileViewModel = { ViewModel: model, Id: SecurityProfileId, ProfileId: $('#ProfileId').val(), JobTitleId: $('#JobTitle').val(), SecurityProfileTypeId: $('#SecurityProfileType').val(), Status: $('#ddlStatus').val(), Reason: $('#txtReason').val(), Mode: $('#hidMode').val() };
$.ajax({ url: '/SecurityProfile/Edit', type: 'POST', contentType: 'application/json; charset=utf-8', dataType: 'json', data: JSON.stringify(SecurityProfileViewModel), success: function (data) { alert(data); window.location.href = '/SecurityProfile/Index'; } });
Aber nichts funktioniert folgendermaßen. Ich bekomme Modell ist undefined Fehler
Ich habe das hier im Detail erklärt http://stackoverflow.com/a/41312348/2592042 –