POST http://localhost:XXXX/Controller/Action 500 (Internal Server Error)
實際送出的程式碼
- $.ajax({
- url: '/Question/UpdateThumbPartial',
- data: { id: $('input[name="id"]').val(), isThumbUp: true },
- type: 'post',
- cache: false,
- success: function (response) {
- console.log(response);
- }
- });
F12開發者> Network> 找到剛剛發的 Ajax post
@Html.HiddenFor(model => model.Id)
因為 prop 的命名原則是大寫,所以造出來的 hiddenfield name 也會是大寫,key錯就抓不到值了。
沒有留言:
張貼留言