AJAX JSON没有使用很多值 [英] AJAX JSON is not working with lots of values

查看:90
本文介绍了AJAX JSON没有使用很多值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的专家,



我有点麻烦,我正在做一个ASP.Net项目,在我的项目中使用Ajax JSON来传输数据,



我在很多页面都使用过这个,



但是在一个页面中我转移了21个通过AJAX JSON的值,但发生了一些事情,它不起作用,

但是当我在VISUAL STUDIO中运行项目时它正在工作,但是当我在实时服务器上发布它时它无效。



i在另一个页面中使用了这个方法,但它只传输了2个值,它运行得很好。



i使用了像这样的ajax代码....没关系.. ???



Dear Experts,

I am in a little Trouble, I am doing an ASP.Net project, And in my project am using Ajax JSON for transfering the datas,

I have used this in lots of pages,

But in one page i have transferred 21 values through AJAX JSON, but something happend, its not working,
but it is working when i run project in VISUAL STUDIO, but it is not working when i published it in live server.

i have used this method in another page but it transferred only 2 values, it is working perfectly.

i have used the ajax code like this.... is it fine..???

$.ajax(
               {
                   type: "POST",                  
                   url: "StudentCreation.aspx/Save_Student",
                   dataType: "json",
                   data: JSON.stringify({
                       "Division_ID": _div_ID, "_FirstName": _FirstName, "_MiddleName": _MiddleName, "_LastName": _LastName,
                       "_Address": _Address,
                       "_Sex": _Sex,
                       "_DOB_Day": _DOB_Day,
                       "_DOB_Month": _DOB_Month,
                       "_DOB_Year": _DOB_Year,
                       "_Mobile1": _Mobile1,
                       "_Mobile2": _Mobile2,
                       "_Land_Line": _Land_Line,
                       "_PinCode": _PinCode,
                       "_Country_ID": _Country_ID,
                       "_State_ID": _State_ID,
                       "_State_Or_Province": _State_Or_Province,
                       "_Email": _Email,
                       "_Parent_Name": _Parent_Name,
                       "_Relation": _Relation,
                       "_Profile_PIC": _Profile_PIC,
                       "_UserName": _UserName
                   }),
                   contentType: "application/json; charset=utf-8",
                   success: function (json) {

                       if (json.d == 1) {
                           $.modal.alert("This User or UserID already Exists. Please Correct it.", { blocker: true });
                       }
                       else
                       {
					   alert("A");
                           startUploading();
                           
                           
                       }
                       
                       

                      

                   }

               });









请帮我解决这个问题。



谢谢和问候,



Dileep ....





Please Help me to solve this problem.

Thanks And Regards,

Dileep....

推荐答案

.ajax(
{
type: POST
url: StudentCreation.aspx / Save_Student
dataType: json
data: JSON .stringify({
Division_ID:_ div_ID, _ FirstName:_ FirstName, _ MiddleName:_ MiddleName,< /温泉n> _ LastName:_ LastName,
_Address:_ Address,
_ Sex:_Sex,
_ DOB_Day:_DOB_Day,
_ DOB_Month:_DOB_Month,
_DOB_Year:_DOB_Year,
_ Mobile1:_Mobile1,
_ Mobile2:_Mobile2,
_ Land_Line:_Land_Line,
_ PinCode:_PinCode,
_ Country_ID:_ Country_ID,
_State_ID:_ State_ID,
_ St​​ate_Or_Province:_ State_Or_Province,
_ Email:_Email,
_ Parent_Name:_ Parent_Name,
_ Relation:_ Relation,
_ Profile_PIC:_Profile_PIC,
_ UserName:_UserName
}),
contentType: application / json; charset = utf-8
成功: function (json){

if (json.d == 1 ){
.ajax( { type: "POST", url: "StudentCreation.aspx/Save_Student", dataType: "json", data: JSON.stringify({ "Division_ID": _div_ID, "_FirstName": _FirstName, "_MiddleName": _MiddleName, "_LastName": _LastName, "_Address": _Address, "_Sex": _Sex, "_DOB_Day": _DOB_Day, "_DOB_Month": _DOB_Month, "_DOB_Year": _DOB_Year, "_Mobile1": _Mobile1, "_Mobile2": _Mobile2, "_Land_Line": _Land_Line, "_PinCode": _PinCode, "_Country_ID": _Country_ID, "_State_ID": _State_ID, "_State_Or_Province": _State_Or_Province, "_Email": _Email, "_Parent_Name": _Parent_Name, "_Relation": _Relation, "_Profile_PIC": _Profile_PIC, "_UserName": _UserName }), contentType: "application/json; charset=utf-8", success: function (json) { if (json.d == 1) {


.modal.alert( 此用户或用户ID已存在。请更正。,{blocker: true });
}
else
{
alert( A);
startUploading();


}





}

});
.modal.alert("This User or UserID already Exists. Please Correct it.", { blocker: true }); } else { alert("A"); startUploading(); } } });









请帮我解决这个问题。



谢谢和问候,



Dileep ....





Please Help me to solve this problem.

Thanks And Regards,

Dileep....


在web.config中这样使用



use like this in web.config

<system.web.extensions>
   <scripting>
     <webservices>
       <jsonserialization maxjsonlength="2147483644" />
     </webservices>
   </scripting>
 </system.web.extensions>


这篇关于AJAX JSON没有使用很多值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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