HttpHandler using Default Namespace
March 22, 2009 11:01 AM Subscribe
Why can't I use the default namespace (i.e., no namespace) with an HttpHandler?
I have an HttpHandler called Handler that I compile into a DLL and put in the /bin folder of my ASP.NET app. Then I have a .ashx file:
However, if I wrap Handler in a gratuitous namespace, say foo, and change the .ashx to
I have an HttpHandler called Handler that I compile into a DLL and put in the /bin folder of my ASP.NET app. Then I have a .ashx file:
<% @ webhandler language="C#" class="Handler" %>but I get a cannot create type 'Handler' error.
However, if I wrap Handler in a gratuitous namespace, say foo, and change the .ashx to
<% @ webhandler language="C#" class="foo.Handler" %>it works fine. Why can't I use no namespace, er, the default namespace? Microsoft omits a namespace in many examples of HttpHandlers on the msdn website.
This thread is closed to new comments.
Unless there's a compelling reason not to, I'd just use a namespace.
Microsoft omits a namespace in many examples of HttpHandlers on the msdn website.
In my experience, example code in vendor documentation is not necessarily exemplary code.
posted by Deathalicious at 11:31 AM on March 22, 2009