c# - unable to receive data from client -
i trying send 2 lists , date value client server. create url , when alert correct. when send data server trying extract don't values correctly. here code jq :
$("#insert").click(function () { listofsit = ""; $(".sel").each(function () { listofsit += $(this).val() + ","; }); listofsit += "#"; //alert(listofsit); listofmem = ""; $(".clsid").each(function () { listofmem += $(this).html() + ","; }); listofmem += "#"; // alert(listofmem); var date = $("#date").val(); var url = "rollcall.aspx?cmd=ins&sitlist=" + listofsit + "&memlist=" + listofmem +"&date=" + date; // alert(url); $.post(url, function (d) { alert(d) }); }); and here c# part:
if (cmd == "ins") { mydb db = new mydb(); string[] sitlst = request.querystring[1].tostring().split(','); string[] memt = request.querystring[2].tostring().split(','); var date = request["date"]; response.write("1"); cmd = "fillgrid"; response.end(); }
you've put # in url. mean after # (memlist , date parameters) considered url fragment, not part of querystring.
remove # , should work.
Comments
Post a Comment