Neir0
Neir0

Reputation: 13367

redirect ajax requests

i want redirect ALL ajax requests(with X-Requested-With:XMLHttpRequest in header) to action: ajax(string function, string args) . How can i do it?

For example: browser send ajax query with paramerts function=getImage&args=4 to url http://localhost/post/123 but we redirect query to http://localhost/ajax.

Upvotes: 0

Views: 173

Answers (2)

Lorenzo
Lorenzo

Reputation: 29427

Use a custom route and/or route constraint.

Look here for more info.

Upvotes: 1

Jarrett Widman
Jarrett Widman

Reputation: 6419

Probably something like Server.Transfer() would work best

Upvotes: 0

Related Questions