Feb 20, 2012, 5:40 PM
DirectMethod request fails in hosting service
Hi,
I have the following code in my Login.aspx view:
I get a failed response 200 with message "BADRESPONSE: syntax error"
Does anyone know why this happens??
Thanks,
I have the following code in my Login.aspx view:
Ext.net.DirectMethod.request({
url: "/Account/Login/",
cleanRequest: true,
params: {
"liveAccount": account,
"ReturnUrl": Ext.urlDecode(String(document.location).split('?')[1]).r || '/'
},
failure: function (errorMessage, response, extraParams, o) {
log("Usuário com conta " + user.emails.account + " não tem autorização para acessar essa página. Por favor contactar o administrador");
}
});
This calls the following method in my controller: [AcceptVerbs(HttpVerbs.Post)]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings",
Justification = "Needs to take same parameter type as Controller.Redirect()")]
public ActionResult Login(string liveAccount, string returnUrl = null)
{
if (repo.getClienteIDParaUsuario(liveAccount) == -1)
{
return new AjaxResult { ErrorMessage = "Acesso não permitido para a conta " + liveAccount + "." };
}
HttpCookie cookie = new HttpCookie("ClienteID");
cookie.Value = repo.getClienteIDParaUsuario(liveAccount).ToString();
cookie.Expires = DateTime.Now.AddMonths(1);
HttpContext.Response.Cookies.Add(cookie);
this.FormsAuth.SignIn(liveAccount, true);
if (!String.IsNullOrEmpty(returnUrl))
{
return this.Redirect(returnUrl.Replace("default.aspx", ""));
}
return this.RedirectToAction("Home", "Index");
}
This code works fine in localhost, but when I push it to appharbor,I get a failed response 200 with message "BADRESPONSE: syntax error"
Does anyone know why this happens??
Thanks,