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

Popular posts from this blog

Change php variable from jquery value using ajax (same page) -

Pull out data related to my apps from Android Play Store and iOS App Store -

How can I fetch data from a web server in an android application? -