I use my PHP back-end to detect AJAX requests by checking for a value in $_SERVER[\'HTTP_X_REQUESTED_WITH\'].
This gives me a reliable detection, making
Let you Controller
In your View
Back in your Controller
Check these security guidelines from OpenAjax.
Also, read the article on codinghorror.com Annie linked.