请教jquery ajax的500 internalservererror Server Error问题

IIS下部署.NET程序报Http&status:&500&Internal&Server&Error
公司的一个web应用在windows 2003下部署时没有任何问题,但是放到xp系统下就出现了翻页报错,具体报错如下:
Http status: 500 Internal Server Error
ajaxOptions: error
thrownError: undefined
“/”应用程序中的服务器错误。
--------------------------------------------------------------------------------
未将对象引用设置到对象的实例。
说明: 执行当前 Web
请求期间,出现未经处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。
异常详细信息: System.NullReferenceException: 未将对象引用设置到对象的实例。
执行当前 Web
请求期间生成了未经处理的异常。可以使用下面的异常堆栈跟踪信息确定有关异常原因和发生位置的信息。&
[NullReferenceException: 未将对象引用设置到对象的实例。]
开始还以为是IIS部署以及.net framework 版本的问题 经过各种配置和重装还是没有解决问题。
后来发现凡是出现翻页报错的程序连接的数据库都是sqlserver2000的数据库,而配置文件里的dialect配置的时候选择的是:NHibernate.Dialect.MsSql2005Dialect&
修改为NHibernate.Dialect.MsSql2000Dialect之后问题解决
分析原因应该是MsSql2005Dialect只能操作SQL2005的数据库的分页,生成的sql语句不同,所以在连接的数据库2000版本时问题就出现了。嗨!微软你做的软件,向下兼容不好啊!!!
已投稿到:
以上网友发言只代表其个人观点,不代表新浪网的观点或立场。请教jquery ajax的500 Internal Server Error问题_百度知道
请教jquery ajax的500 Internal Server Error问题
提问者采纳
最常见的原因是服务器端代码有bug500是服务器内部错误,一般来说和你客户端的请求没有关系,在处理你的请求是发生异常了
其他类似问题
为您推荐:
jquery的相关知识
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁jQuery.ajax POST 500 Internal Server Error on PHP script - Stack Overflow
to customize your list.
Stack Overflow is a community of 4.7 million programmers, just like you, helping each other.
J it only takes a minute:
Join the Stack Overflow community to:
Ask programming questions
Answer and help your peers
Get recognized for your expertise
I am getting this error on a js function that sends an ajax request to a login script. here is the code:
function validateLogin(){
$(document).ready(function(){
$("#loginform").submit(function(){
type: "POST",
url: "./php/autologin.php",
'login': $("#login").val(),
'password': $("#password").val()
dataType: "json",
success:function(data){
if(data.status === "success"){
alert(data.message);
window.location = "./userarea.html?user=".concat(data.user);
} else if (data.status === "error"){
alert(data.message);
error:function(thrownError){
console.log(thrownError);
i am getting a POST 500 Internal Server Error on the url from the above code
and here is what is being printed in the console of chrome:
POST http://localhost/capstone/atomos-4.0/php/autologin.php 500 (Internal Server Error) jquery-1.7.2.min.js:4
f.support.ajax.f.ajaxTransport.send jquery-1.7.2.min.js:4
f.extend.ajax jquery-1.7.2.min.js:4
(anonymous function) validateLogin.js:4
f.event.dispatch jquery-1.7.2.min.js:3
f.event.add.h.handle.i jquery-1.7.2.min.js:3
I don't really understand what the post error is trying to tell me, can any one give me a nudge in the right direction to solving this. let me know if you need more info. thanks
EDIT: here is the php function in question:
autologin.php
include './login.php';
$login = $_POST['login'];
$password = $_POST['password'];
$loginattempt = json_decode(login($login, $password));
if ($loginattempt-&{'status'} === "success") {
return json_encode(array('status' =& "success", 'message' =& "Login Successful!"));
return json_encode(array('status' =& "error", 'error' =& "loginfailure", 'message' =& ($loginattempt -& {"message"})));
and login.php:
include './connnect_to_mysql.php';
function login($log, $pass) {
$connection = json_decode(connect_to_mysql());
if ($connection-&{'status'} === "success") {
$sqlquery = mysql_query("SELECT * FROM userdata WHERE login='$log' AND password='$pass'") or die(mysql_error());
if (mysql_num_rows($sqlquery) == 1) {
setcookie("user", $log, 60 * 60 * 24);
return json_encode(array('status' =& "success", 'message' =& "Login Successful.", 'user' =& $log));
return json_encode(array('status' =& "error", 'error' =& "loginfailure", 'message' =& mysql_error()));
return json_encode(array('status' =& "error", 'error' =& "connectionerror", 'message' =& $connection -& {'message'}));
connect_to_mysql.php:
function connect_to_mysql() {
$con = mysql_connect('localhost', 'user', 'pass') or die(mysql_error());
if ($con) {
$db = mysqli_select_db($con, 'db')or die(mysql_error());
if ($db) {
return json_encode(array('status' =& "success", 'message' =& "connected"));
return json_encode(array('status' =& "error", 'message' =& mysql_error()));
31.4k53265
fix include './connnect_to_mysql.php'; to include './connect_to_mysql.php'; :)
Your Answer
Sign up or
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Post as a guest
By posting your answer, you agree to the
Not the answer you're looking for?
Browse other questions tagged
Stack Overflow works best with JavaScript enabledjquery.ajax的url指向ashx,错误码500
[问题点数:30分,结帖人seeransky]
jquery.ajax的url指向ashx,错误码500
[问题点数:30分,结帖人seeransky]
不显示删除回复
显示所有回复
显示星级回复
显示得分回复
只显示楼主
匿名用户不能发表回复!|
每天回帖即可获得10分可用分!小技巧:
你还可以输入10000个字符
(Ctrl+Enter)
请遵守CSDN,不得违反国家法律法规。
转载文章请注明出自“CSDN(www.csdn.net)”。如是商业用途请联系原作者。}

我要回帖

更多关于 jquery ajax 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信