我写了一个代码,真正在本地主机上完美工作,但在我的生产服务器上,我显示错误,提交按钮附加到成功事件的Response.Result参数未定义,但一切正常本地服务器,我重新张贴在服务器上的主要extjs包,认为一些文件已损坏,问题仍然存在,请我不知道还有什么要做,我的代码列在下面。问题与extjs
给出问题的主线是“resp.result.data.level;”
Ext.onReady(函数(){ Ext.QuickTips.init();
var login = new Ext.FormPanel({
id: 'login_form',
renderTo: 'login2',
url: '../server/login.ashx',
title: 'Enter your Pin Number and Jamb Number',
width: 280,
height: 250,
labelAlign: 'top',
bodyStyle: 'width:300px;height:300px;margin:0 auto;',
frame: true,
items: [
{ xtype: 'textfield', fieldLabel: 'Registration Numberss', name: 'reg', width: '70%', allowBlank: false, minLegth: 5, maxLength: 15 },
{ xtype: 'textfield', fieldLabel: 'Pin Number', name: 'pin', id: 'pin', width: '70%',
allowBlank: false, inputType: 'password', minLegth: 5, maxLength: 15, minLengthText: 'Password must be at least 6 characters long.'
}
],
buttons: [{
text: 'Login',
handler: function() {
pin = Ext.get('pin').getValue();
login.el.mask('Please wait', 'x-mask-loading');
login.getForm().submit({
url: '../server/login.ashx',
success: function (loginForm, resp) {
login.getForm().reset();
var level = resp.result.data.level;
if (level == "0") {
controller.getLayout().setActiveItem(1);
}
else if (level == "1") {
controller.getLayout().setActiveItem(2);
hostelData.load();
}
else {
document.location = "../hostelAllocation/Report.aspx?val=" + pin;
}
},
failure: function (loginForm, resp) {
login.el.unmask();
var status = resp.result.data.status;
var reg = resp.result.data.reg;
if (status == "0") {
Ext.MessageBox.alert('Failure', 'Invalid Pin!');
}
else {
Ext.MessageBox.alert('Failure', 'The pin has been used by another user,<br/> with User Name: ' + reg);
}
}
});
}
},
{ text: 'Cancel',
handler: function() {
document.location = "../index.htm"
}
}]
});
我真的需要知道这个问题的解决方案有什么帮助吗? – 2010-10-26 13:21:47
尝试并找出什么_is_在'使用Firebug(在'success'和'failure'函数中尝试'console.log(resp)')来调用resp.result'。 – Wolph 2010-10-26 13:30:37
WoLpH先生,我真的很高兴您的专业建议,问题来自我的生产服务器。服务器被配置为支持DotNet框架2.0,但我在本地服务器上使用了一些.Net 4.0功能。所以我已经解决它,它的工作完美, 感谢和上帝保佑! – 2010-10-28 14:57:09