ASP.NET - Passing JSON from jQuery to ASHX

前端 未结 8 524
你的背包
你的背包 2020-11-28 21:25

I\'m trying to pass JSON from jQuery to a .ASHX file. Example of the jQuery below:

$.ajax({
      type: \"POST\",
      url: \"/test.ashx\",
      data: \"{\         


        
8条回答
  •  攒了一身酷
    2020-11-28 21:46

    if using $.ajax and using .ashx to get querystring ,dont set datatype

    $.ajax({ 
        type: "POST", 
        url: "/test.ashx", 
        data: {'file':'dave', 'type':'ward'}, 
        **//contentType: "application/json; charset=utf-8",   
        //dataType: "json"**    
    }); 
    

    i get it work!

提交回复
热议问题