컨트롤러에 값 2 개를 게시하는 데 아약스를 사용하고 있는데 컨트롤러에 값이 있지만보기가 표시되지 않습니다. 제가 여기서 잘못하고있는 일을 도와주세요. 감사.MVC + 컨트롤러보기가 표시되지 않습니다.
자바 스크립트 :
function grantPermission() {
window.FB.login(function (response) {
if (response.authResponse) {
uid = response.authResponse.userID;
accesstoken = response.authResponse.accessToken;
var postData = { facebookUID: uid, facebookAccessTok: accesstoken };
$.ajax({
url: '@Url.Action("SavePhoto")',
data: postData,
dataType: 'json',
success: function (response) {
// process the results from the controller action
// window.location.href = response.Url;
}
});
} else {
console.log('User cancelled login or did not fully authorize.');
alert('User cancelled login');
}
}, { scope: 'publish_stream' });
};
버튼 :
<input type="button" id="auth-loginlink" value="Proceed" onclick="grantPermission();"/>
컨트롤러 : 당신은 뭔가 재치를 할 필요가
public PartialViewResult SavePhoto(string facebookUID, string facebookAccessTok)
{
return PartialView("BlurredPhoto");
}
'응답'데이터 란 무엇입니까? 당신은 그것으로부터'Url'을 얻으려고하고 있습니까? –