Ext.Ajax.request里面success,老爆ext-all.js的错误!
function validatorData() {
var UserName = Ext.getCmp("UserName").getValue();
var Password = Ext.getCmp("Password").getValue();
if (Ext.util.Format.trim(UserName) == "" || Ext.util.Format.trim(Password) == "") {
Ext.Msg.alert("警告", "请正确输入数据,用户名和密码都不能够为空!");
return;
}
Ext.Ajax.request
({
url: "Index.aspx", //请求的地址
params: { ParamValue: "1", ParamUserName: UserName, ParamPassword: Password }, //发送的参数
success: function (response,option) {
debugger
var obj = Ext.util.JSON.decode(response.responseText); //返回的信息
if (obj.success == true) {
Ext.Msg.alert("好消息", "好消息:你登陆成功了!");
//清除输入框
Ext.getCmp("UserName").setValue("");
Ext.getCmp("Password").setValue("");
loginWindow.hide();
}
else {
Ext.Msg.alert("坏消息", "坏消息:你登陆失败了!");
}
},
failure: function () {
Ext.Msg.alert("坏消息", "坏消息:你登陆出现异常了!");
}
});
}
//这里是后台代码
string ParamValue = Request["ParamValue"];
if (ParamValue == "1")
{
string UserName = Request["ParamUserName"];
string Password = Request["ParamPassword"];
MODEL.ext.user u = new MODEL.ext.user();
u = BLL.ext.GetUser();
if (u.UserName.Trim() == UserName && u.PassWord.Trim() == Password)
{
Response.Write("{success:true}");
}
else
{
Response.Write("{success:false}");
}
}
Ext.Ajax.reques
补充:.NET技术 , C#