Hi,
I am writing a module that I want to be able to be called either by client
code or by a webservice method, and I want the module's function to be able
to detect whether it is being called directly from the client, or from the
web service. The idea is that if it is running in the client space then it
will contact the web service itself and forward the call.
Is there any way that the module can detect where it is being hosted?
Thanks (hopefully) in advance,
David
NuTcAsE - 18 Jan 2006 16:44 GMT
One way (not ideal but a kinda cheap way) is to check if the
System.Web.HttpContext.Current is null. If it is null it is being
invoked outside the ASP.Net pipeline and most likely though a win app.
If it is not null then its being invoked from within the ASP.Net
pipeline.
Hope this helps..
- NuTcAsE
David Hyde - 19 Jan 2006 16:25 GMT
Yup, that works. Thanks...
> One way (not ideal but a kinda cheap way) is to check if the
> System.Web.HttpContext.Current is null. If it is null it is being
[quoted text clipped - 5 lines]
>
> - NuTcAsE