While debugging I verified this js func is called:
var oAuthManager = {
loginWithGoogle_OnClick: function () {
createAjaxRequest("Register/GetAuthorizeRequestToken", {
'providerType': 'google'}).done(function (res) { });
// createAjaxRequest("Register", null).done(function (res) { });
}
};
and it calls:
function createAjaxRequest(url,data) {
return $.ajax(
{
type: "POST",
url: url,
data: data
});
};
So why cannot I get to this RegisterController’s method?
[HttpPost] \\tried with and without this
public void GetAuthorizeRequestToken(string providerType)
{
var authType = (OAuthProviderTypes)Enum.Parse(typeof(OAuthProviderTypes), providerType);
mAuthorizationService.GetAuthorizeRequestToken(authType);
}
other controllers works fine with othe js.
I get the error:
POST http://localhost:8976/Register/GetAuthorizeRequestToken 500 (Internal Server Error)
I have two breakpoints:
-
one in the ctor which stops OK
-
second in the beginning of the webMethod. I see the thread never reaches there.
Elad,
I was able to reproduce your code pretty much line by line and is working. So let’s analyze the issue.
You are not getting a 404 (not found, or a 403 (request denied)… You are getting a 500 error, which means the application broke somewhere.
So I would start investigating some of these points:
If you find nothing, I would also try the following to isolate the problem:
That should be a good start, I hope it helps,
-covo