jQuery的阿贾克斯后 - 内部服务器500错误 [英] Jquery Ajax Post - internal server 500 error
本文介绍了jQuery的阿贾克斯后 - 内部服务器500错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想发布使用Ajax。
I am trying to post with ajax.
但我刚开内部服务器的500错误。
but I am gettin internal server 500 error.
$.ajax({
type: "POST",
url: "Services/UserServsice.asmx/UserLogin",
data: "{'Username':'" + username + "','Password':'" + password + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (result) {
debugger;
},
error: function () {
}
});
方法:
namespace Project.Services
{
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
[System.Web.Script.Services.ScriptService]
public class UserService : System.Web.Services.WebService
{
[WebMethod(EnableSession = true)]
public string UserLogin(string Username, string Password)
{
if (Username == "yasin" && Password == "123456")
{
return "true";
}
else
{
return "false";
}
}
}
}
这是什么问题? 为什么我收到内部服务器的500错误?
What is the problem ? why i am getting the internal server 500 error ?
推荐答案
首先您需要启用,看看你的web消息的详细错误,因为这是与出提供信息一般邮件的上什么真正的发生出于安全考虑。
First you need to enable and see detailed errors of your web messages because this is a general message with out giving information's on whats really happening for security reasons.
请参考下面的链接我希望这将有助于你的错误。
Refer Below link i hope it will help for your error.
这篇关于jQuery的阿贾克斯后 - 内部服务器500错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文