views:

66

answers:

3

I seem to recall being able to configure asp.net ajax using attributes on the methods to use an HTTP get rather than an HTTP post.

Using a GET is possible isn't it?

and to make this fun, which is more performant?

A: 

AJAX calls using GET are more performant than POST according to Yahoo!'s YSlow application.Details at http://developer.yahoo.com/performance/rules.html It is possible to set up ASP.NET to handle gets. Just get the ASP.net app to handle the AJAX params in a querystring.

AutomatedTester
yup, agree with that. Now how to setup my asp.net to do GET's?
BozoJoe
A: 

GET is more performant as it is idempotent (and does not contain a message body) where as POST does. Any data pertaining to the client state has to be sent with the help of a cookie/query string in GET. web servers may also exercise constraints on URL length

If you are going to look for html controls (or server controls) in your server side code, you wold have to POST the page. The server can look at the Request method (GET/POST) and does not differentiate between a regular request and an AJAX request

ram
A: 

I cant believe I forgot how I had done this before

    [WebMethod()]
    [ScriptMethod(UseHttpGet=true)] 
    public void JustSaveSomeData(int X, int Y)
    { 
         //do stuff
         return;
    }
BozoJoe