여기서 찾고있는 답을 찾을 수없는 것 같습니다 ...
NULL
내 ASP.net 컨트롤러로 전달됩니다- iid
값이 있습니다.
function Dismiss(iid) {
$.ajax({url: '@Url.Action("DismissNotification")', type: 'GET',Data: {id:iid}, success: function(result){
$('#' + id).hidden();
}});
}
[Authorize]
[HttpGet]
public bool DismissNotification(string id)
{
if (!string.IsNullOrEmpty(id))
{
_notificationService.Dismiss(id);
return true;
}
return false;
}
어떤 아이디어?
클라이언트가 서버에 데이터를 보내는 설정 속성은 호출 data
되지 않습니다.Data
이것은 작동합니다
$.ajax({
url: '@Url.Action("DismissNotification")',
type: 'GET',
data: { id: iid },
success: function (result) {
console.log('result',result);
}});
$.get
방법을 사용할 수도 있습니다.
$.get('@Url.Action("DismissNotification")', { id: iid }, function (result) {
console.log('r', result);
});
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다