ASP.NET Calling WebMethod with jQuery AJAX “401 (Unauthorized)”

Problem solved This was driving me crazy. Inside ~/App_Start/RouteConfig.cs change: settings.AutoRedirectMode = RedirectMode.Permanent; To: settings.AutoRedirectMode = RedirectMode.Off; (Or just comment the line) Also if friendly URLs are enabled you need to change url: “ConsultaPedidos.aspx/GetClients”, To: url: ‘<%= ResolveUrl(“ConsultaPedidos.aspx/GetClients”) %>’, Hope this help somebody else

“Invalid JSON primitive” in Ajax processing

Just a guess what does the variable json contain after var json = Sys.Serialization.JavaScriptSerializer.serialize(obj);? If it is a valid json object like {“foo”:”foovalue”, “bar”:”barvalue”} then jQuery might not send it as json data but instead serialize it to foor=foovalue&bar=barvalue thus you get the error “Invalid JSON primitive: foo” Try instead setting the data as string … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)