Using jQuery's getJSON method with an ASP.NET Web Form

前端 未结 3 1449
清酒与你
清酒与你 2020-12-05 08:32

How do I go about calling a method on an ASP.NET Web Form page using the getJSON method on jQuery?

The goal is this:

  1. User clicks on a list item
3条回答
  •  情深已故
    2020-12-05 09:14

    You can also use a GetJSON, but you should alter the WebMethod in that case. You should decorate it with:

    [WebMethod(EnableSession = true)]       
    [ScriptMethod(UseHttpGet =false, ResponseFormat = ResponseFormat.Json)]
    

    Doing a get might not be what you desire.

提交回复
热议问题