Psst! Did you know DevelopmentNow is a mobile web site design agency?

Contact us for help mobilizing your site, or to sign up for our beta Mobile Web SDK!
all groups > asp.net > january 2006 >

asp.net : adding a HTTPHandler ASP.NET 2.0


Alexandre
1/31/2006 5:15:36 PM
Hi,

I have created an HTTPHandler in ASP.NET 2.0

I now the way to add it in the web.config but my question will be
stupid...

when I compile my application in asp.net 2.0 from vs 2k5...
umm what is the name of the assembly that is produced? I cannot seem to
find it anywhere on my server, I ve tryed to publish, compile and still
I cannot see the dll that is being produced.

so my question is this, since my HTTPHandler is in my asp.net project
and that I cannot find the produce assembly,

what assembly name do I reference ?

Best regards,
Alexandre Brisebois
David Barkol
1/31/2006 5:44:01 PM
Alexandre,

The compilation model has changed in ASP.NET 2.0. By default, you do
not create assemblies for your projects. Here is a link that will
explain the changes:

http://msdn.microsoft.com/msdnmag/issues/06/01/ExtremeASPNET/

David Barkol
www.neudesic.com
Alexandre
1/31/2006 5:58:36 PM
David,

I found some informatino
registered my handler on a specific extention bu when ever I try to use
the handler its as it it never goes to it and I get a 404 error.

here is how I register my handler:
<httpHandlers>
<add verb="*" path="*.doc" type="CervoHandler"/>
</httpHandlers>

the code is in my App_Code/

this is my handler,

public class CervoHandler : IHttpHandler
{

public void ProcessRequest(HttpContext context)
{
string strCurrentPath = context.Request.Path.ToLower();
context.Response.ContentType = "text/plain";

context.Response.Write(Live.Cervo.Server.AbsoluteRedirect.FrameRedirect(strCurrentPath));
}

public bool IsReusable
{
get
{
return true;
}
}

}


now everything complies, web.config does not complain, I just get a
404.
then again I have the

<add verb="POST,GET" path="ajaxpro/*.ashx"
type="AjaxPro.AjaxHandlerFactory, AjaxPro.2"/>

and its working fine, so I'm kind of lost right now trying to figure
out why my new handler is not being used...

can you shed some light ?

Regards,
Alexandre Brisebois
AddThis Social Bookmark Button