How to tell who called an HttpHandler
How can I tell from within an ASP.NET HttpHandler if it is executing because o开发者_Go百科f a call to
Server.Execute("myHandler.ashx")
or because of the user linking directly to myHandler.ashx
? (Besides using a querystring parameter).
Can't you add a querystring parameter? If present comes from Server.Execute(), otherwise direct link.
You should still have access to the HttpContext from within the handler, so you should still be able to access cookies and session to determine any authenticated users (if that's what you're looking for).
精彩评论