M
Michael Nemtsev [MVP]
Hello,
In the current application we have several httpmodules to process pages,
and we have several pages with calls directly through the XMLHttpRequest.
Now the requiremens is to detect the calls through the XMLHttpRequest and
apply addional actions in httpmodule for these types of call.
Because they dont use ASP.NET AJAX for this I cant use ScriptManager.IsInAsyncPostBack.
Everything what comes into my my how to catch these calls is check CurrentContext.Request.ContentType
for the string entry which is set like
request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
before making XMLHttpRequest call. If !(string.IsNullOrEmpty(CurrentContext.Request.ContentType))
then we have XMLHttpRequest call.
I wonder if there are others way to check if call made via XMLHttpRequest?!
---
WBR,
Michael Nemtsev [Microsoft MVP] :: blog: http://spaces.live.com/laflour
"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo
In the current application we have several httpmodules to process pages,
and we have several pages with calls directly through the XMLHttpRequest.
Now the requiremens is to detect the calls through the XMLHttpRequest and
apply addional actions in httpmodule for these types of call.
Because they dont use ASP.NET AJAX for this I cant use ScriptManager.IsInAsyncPostBack.
Everything what comes into my my how to catch these calls is check CurrentContext.Request.ContentType
for the string entry which is set like
request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
before making XMLHttpRequest call. If !(string.IsNullOrEmpty(CurrentContext.Request.ContentType))
then we have XMLHttpRequest call.
I wonder if there are others way to check if call made via XMLHttpRequest?!
---
WBR,
Michael Nemtsev [Microsoft MVP] :: blog: http://spaces.live.com/laflour
"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo