HttpHandler configuration in ASP.NET 2.0

G

Guest

Let's say I have a class named GenericImageHandler in namespace BillRyan and
I'm storing it in the App_Code folder in a 2.0 application. What does the
web config setting look like? Here's what I'm using but each time the
application starts, I get a configuration error telling me that i'm not
specifying the type correctly. What am I doing wrong? - I'm having this
problem with both the Beta 2 and the Sept CTP. Also, I've double and tripled
checked spelling and namespaces, [the class is definitely in App_Code], have
added a space after the comma and removed it as it is below, and verified
that I don't have any spaced after the App_Code. This happens btw with all
file types

<httpHandlers>

<add verb="*" path="*.gif"

type="BillRyan.GenericImageHandler,App_Code" />

</httpHandlers>
 
G

Guest

Thanks Buddy - that fixed it.

Juan T. Llibre said:
You shouldn't be specifying the place where the code is located.

See the example for MyHandler assembly at :

http://msdn2.microsoft.com/en-us/library/bya7fh0a(en-us,VS.80).aspx




Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
W.G. Ryan said:
Let's say I have a class named GenericImageHandler in namespace BillRyan and
I'm storing it in the App_Code folder in a 2.0 application. What does the
web config setting look like? Here's what I'm using but each time the
application starts, I get a configuration error telling me that i'm not
specifying the type correctly. What am I doing wrong? - I'm having this
problem with both the Beta 2 and the Sept CTP. Also, I've double and tripled
checked spelling and namespaces, [the class is definitely in App_Code], have
added a space after the comma and removed it as it is below, and verified
that I don't have any spaced after the App_Code. This happens btw with all
file types

<httpHandlers>

<add verb="*" path="*.gif"

type="BillRyan.GenericImageHandler,App_Code" />

</httpHandlers>
 
G

Guest

Juan - that fixed the problem but I have a dumb question. At the bottom of
the page you sent me, this code snippet is there:

<configuration>
<system.web>
<httpHandlers>
<add verb="*"
path="*.New"
type="MyHandler.New,MyHandler"/>
<add verb="GET,HEAD"
path="*.MyNewFileExtension"
type="MyHandler.MNFEHandler,MyHandler.dll"/>
</httpHandlers>
<system.web>
</configuration>

Is there a rule as to when you are supposed to use the Assembly name as
well. I noticed the obvious difference of the GET, HEAD in the verb
section, but I was wondering if there was a rule as to when you used the
assembly and/or when you leave it out?

thanks again man,

Juan T. Llibre said:
You shouldn't be specifying the place where the code is located.

See the example for MyHandler assembly at :

http://msdn2.microsoft.com/en-us/library/bya7fh0a(en-us,VS.80).aspx




Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
W.G. Ryan said:
Let's say I have a class named GenericImageHandler in namespace BillRyan and
I'm storing it in the App_Code folder in a 2.0 application. What does the
web config setting look like? Here's what I'm using but each time the
application starts, I get a configuration error telling me that i'm not
specifying the type correctly. What am I doing wrong? - I'm having this
problem with both the Beta 2 and the Sept CTP. Also, I've double and tripled
checked spelling and namespaces, [the class is definitely in App_Code], have
added a space after the comma and removed it as it is below, and verified
that I don't have any spaced after the App_Code. This happens btw with all
file types

<httpHandlers>

<add verb="*" path="*.gif"

type="BillRyan.GenericImageHandler,App_Code" />

</httpHandlers>
 
J

Juan T. Llibre

re:
Juan - that fixed the problem
Great!

re:
I was wondering if there was a rule as to when you used the
assembly and/or when you leave it out?

See : http://msdn2.microsoft.com/en-us/library/46c5ddfy

If the handler code is in the App_Code directory,
you do not need to specify an assembly.

The assembly doesn't exist, yet... ;-)

best,



Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
W.G. Ryan said:
Juan - that fixed the problem but I have a dumb question. At the bottom of
the page you sent me, this code snippet is there:

<configuration>
<system.web>
<httpHandlers>
<add verb="*"
path="*.New"
type="MyHandler.New,MyHandler"/>
<add verb="GET,HEAD"
path="*.MyNewFileExtension"
type="MyHandler.MNFEHandler,MyHandler.dll"/>
</httpHandlers>
<system.web>
</configuration>

Is there a rule as to when you are supposed to use the Assembly name as
well. I noticed the obvious difference of the GET, HEAD in the verb
section, but I was wondering if there was a rule as to when you used the
assembly and/or when you leave it out?
thanks again man,

Juan T. Llibre said:
You shouldn't be specifying the place where the code is located.

See the example for MyHandler assembly at :

http://msdn2.microsoft.com/en-us/library/bya7fh0a(en-us,VS.80).aspx




Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
W.G. Ryan said:
Let's say I have a class named GenericImageHandler in namespace BillRyan and
I'm storing it in the App_Code folder in a 2.0 application. What does the
web config setting look like? Here's what I'm using but each time the
application starts, I get a configuration error telling me that i'm not
specifying the type correctly. What am I doing wrong? - I'm having this
problem with both the Beta 2 and the Sept CTP. Also, I've double and tripled
checked spelling and namespaces, [the class is definitely in App_Code], have
added a space after the comma and removed it as it is below, and verified
that I don't have any spaced after the App_Code. This happens btw with all
file types

<httpHandlers>

<add verb="*" path="*.gif"

type="BillRyan.GenericImageHandler,App_Code" />

</httpHandlers>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top