get/post in a generic handler

642 views Asked by At
[WebMethod]
[ScriptMethod(ResponseFormat = ResponseFormat.Json)]

which of these two is get and which is post? It is used in a generic handler (.ashx file).

2

There are 2 answers

0
Madhu Beela On BEST ANSWER
[WebMethod]
[ScriptMethod(UseHttpGet = true/false, ResponseFormat = ResponseFormat.Json)]
public bool UseHttpGet { set; get; }
Member of System.Web.Script.Services.ScriptMethodAttribute

Summary: Gets or sets a value that indicates whether to invoke the method by using HTTP GET.

Returns: true if the method is invoked by using the HTTP GET command; false if the method is invoked by using the HTTP POST command. The default is false.

we can make both get and post methods

0
chandmk On

ScriptMethod allows you to call the method in Get scenarios. Which otherwise need to be called via POST

MSDN