با سلام من برای ارسال یه رشته طولانی به سمت سرورم مشکل دارم
سعی کردم با تبدیل کردن به اسکی مشکلم رو حل کنم اما خوب مشکل از کاراکتر های خاص داخل رشته هم نبود
ممنون میشم راهنماییم کنید
من از کد پایین استفاده می کنم
$(document).ready( function ()
{ try {
function Ajax(func, data)
{ $.ajax(
{ type: "POST",
url: window.location.href.split('/')[window.location.href.split('/').length - 1] + "/" + func,
data: "{'strParam' : " + data + "}",
contentType: "application/json; charset=utf-8",
dataType: "json",
async: true,
cache: false,
success: function (msg)
{ alert(msg.d);
}, error: function (x, e)
{ alert("The call to the server side failed. " + x.responseText);
} } ); } $("#btnInsert").click(function ()
{ var itemcheck = ""; $("#ContentPlaceHolder1_TreeView1 input").each(function ()
{ if ($(this).attr('checked'))
{ itemcheck += $(this).next().attr('href') + '##'; } })
alert(itemcheck);
var j;
var StrAscii = '';
for (j = 0; j < itemcheck.length; j++)
{ StrAscii += itemcheck.charCodeAt(j);
} Ajax("InsertTree", StrAscii)
}) } catch (err) { alert(err);
}
}
)
[WebMethod]
public static string InsertTree(string strParam)
{ return "Parameter sent to server from client side is " + strParam;
}