ASP.NET - Passing JSON from jQuery to ASHX

前端 未结 8 520
你的背包
你的背包 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:42

    you have to defined the handler properties in web configuration file to handle the user defined extension request formats. here the user defined extension is ".api"

    add verb="*" path="test.api" type="test" replace the url: "/test.ashx" to url: "/test.api" .

提交回复
热议问题