The part of the url after the # is not necessarily related to AJAX. It is the document hashcode or fragment identifier. Modern AJAX patterns do use this identifier as a place to store parameters and other information.
The important fact is that this is never sent to the server. The server can send urls with fragments, but the client never sends the fragment to the server.
You need to parse the url and extract the values after the #. Then you can send them to the server using a GET or POST request or you can make an ajax request and pass the parameters in.
This question has some examples of code that can be used to parse the hashcode, assuming it is formatted like a typical GET query (that is, ?p1=v1&p2=v2). If you are using a framework for your app development, there may be a built-in function you can use for this, such as jquery BBQ.
The #!
syntax is a convention defined by Google: see here. When a crawler encounters this syntax it replaces the !# in the url with a parameter: _escaped_fragment_
. So a url like
http://stackoverflow.com#!p1=v1&p2=v2
becomes
http://stackoverflow.com?_escaped_fragment_=p1%3Dv1%26p2%3Dv2
On your server you can then access the _escaped_fragment_
parameter as you would normally access any other parameter.
Note: the important thing about this particular convention is that it is the web-crawling user-agent (i.e. Googlebot) that rewrites urls to use the _escaped_fragment_. If you use these kinds of urls, and want to make your site crawlable, you should support reading the _escaped_fragment_ parameter. If you don't care about Googlebot for these particular pages, this whole convention is useless to you. Either way, it is the client-side responsibility to handle the parameters in the hashcode.