views:

14

answers:

2

Hi,

Sorry if this is a stupid question. I want to create an HTTP handler within my project. To do this, I created a new class, and tried to implement IHttpHandler.

Each time I do this, I get the error 'End of statement expected'.

I know that normally you can create a new class library and create a class to implement a handler. But why is it not possible to do this in an existing web project?

WT

A: 

Even though its not a best practice to put it in the web project, are you referencing it in the web.config correctly, so it knows to look in the App_Code folder?

<httpHandlers>
    <add verb="*" path="*.yourextention" type="YourHandler, App_Code"/>
</httpHandlers>
hearn
+1  A: 

Create a new object called an ashx or Generic Handler. From there you can put in server side code and output the exact result you would like to dish out. Honestly though I would use WCF though, its a lot easier and you can spit out the data in any data type you like.

Al Katawazi