Last post Mar 20, 2015 08:51 AM by Mikesdotnetting
Mar 20, 2015 06:24 AM|whizkidgps|LINK
I’ve written HttpModule to catch every web request on my web application. HttpModule may receive more requests while navigating across web application. From here I want to filter the requests which are from .ASMX & .SVC alone.
We can apply the filter using below condition, but just want to know is there any other optimistic way instead of checking an extension.
(HttpContext.Current.Request.Path.Contains(".asmx")) || (HttpContext.Current.Request.Path.Contains(".svc"))
Mar 20, 2015 06:45 AM|Mikesdotnetting|LINK
The way you are checking for the file extension can be done in a number of different ways (the difference between them mainly being personal preference) , but essentially, checking the extension like you are doing is the way to filter out requests for certain
Mar 20, 2015 07:19 AM|whizkidgps|LINK
Don't we have any other way to check the request is from Web service\SVC? like request.contenttype and anything??
Mar 20, 2015 07:32 AM|Mikesdotnetting|LINK
Don't we have any other way to check the request is from Web service\SVC?
Do you mean from or for?
Mar 20, 2015 08:40 AM|whizkidgps|LINK
I meant to say "from"....
In my HttpModule, How do I Identify the request from ASMX or SVC among more requests?
Mar 20, 2015 08:51 AM|Mikesdotnetting|LINK
The only way is the way you are doing at the moment.