对于MVC中的ajax代码,参数字典在IE11上包含空条目问题 [英] The parameters dictionary contains a null entry problem on IE11 for ajax code in MVC

查看:128
本文介绍了对于MVC中的ajax代码,参数字典在IE11上包含空条目问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



需要你的帮助,

我们使用Ajax方法来调用MVC控制器方法。



这里是我们使用的示例代码,

Hi,
Need your help,
We are using Ajax methods to call MVC controller methods.

here is the sample code we have used,

var rowID="100";
$.ajax({
                    type: "POST",
                    url: "/home/selectdatafromlist",
                    data: "id=" + rowID,
                    success: function (output) {
//my code
                        },
                        error: function (xhr, status, error) {
                            alert("An AJAX error occured: " + status + "\nError: " + error + "\nError detail: " + xhr.responseText);
                        }
);



错误就是这样,



参数字典包含方法'System.Web.Mvc.ActionResult selectdatafromlist(Int32)'的非可空类型'System.Int32'的参数'id'的空条目。



此代码在Firefox和Chrome上工作正常。



任何解决方案。





提前致谢。


The error is coming like this,

The parameters dictionary contains a null entry for parameter 'id' of non-nullable type 'System.Int32' for method 'System.Web.Mvc.ActionResult selectdatafromlist(Int32)'.

This code is working fine on Firefox and chrome.

any solution for this.


Thanks in advance.

推荐答案

.ajax({
type: POST
url: / home / selectdatafromlist
data: id = + rowID,
成功: function (输出){
// 我的代码
},
错误: function (xhr,status,error ){
alert( 发生AJAX错误: + status + \ nError: + error + \ nnn错误: + xhr.responseText);
}
);
.ajax({ type: "POST", url: "/home/selectdatafromlist", data: "id=" + rowID, success: function (output) { //my code }, error: function (xhr, status, error) { alert("An AJAX error occured: " + status + "\nError: " + error + "\nError detail: " + xhr.responseText); } );



错误就是这样,



参数字典包含非可空类型'System.Int32'的参数'id'的空条目,用于方法'System.Web.Mvc.ActionResult selectdatafromlist(Int32)'。



此代码在Firefox和Chrome上工作正常。



任何解决方案。





提前致谢。


The error is coming like this,

The parameters dictionary contains a null entry for parameter 'id' of non-nullable type 'System.Int32' for method 'System.Web.Mvc.ActionResult selectdatafromlist(Int32)'.

This code is working fine on Firefox and chrome.

any solution for this.


Thanks in advance.


这篇关于对于MVC中的ajax代码,参数字典在IE11上包含空条目问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆