ASHX - What's the secret??!

T

Tim

Guys

I am trying to create an ashx IHttpHandler that will provide images for
me.

This is what I have done so far.

' Start test.ashx

<%@ WebHandler Language="VB" Class="testashx" %>

' End test.ashx


' Start test.ashx.vb

Public Class testashx
Implements IHttpHandler

Public ReadOnly Property IsReusable() As Boolean Implements
System.Web.IHttpHandler.IsReusable
Get

End Get
End Property

Public Sub ProcessRequest(ByVal context As System.Web.HttpContext)
Implements System.Web.IHttpHandler.ProcessRequest

End Sub
End Class

' End test.ashx.vb

and within Webform1.aspx.vb I have
....
Image1.ImageUrl = "test.ashx"
....


Is this all i need to do? - I don't think so because the call to
test.ashx does not appear to hit the code in test.ashx.vb. (I have
tried adding codebehind=blahblah to the ashx file but no difference -
and the example I am looking at does not use this, so i shouldn't need
it.)

There is nothing else in this solution only what is shown here.
The example soultion that i am looking at on
http://www.codeproject.com/aspnet/NetPix.asp
works on my PC but I can't get my simple test solution to work. Is
there something I need to do inorder to register the HttpHandler with
the pipeline?
Or Are there some project settings I am missing?
IIS doesn't seem to need settings neither does web.config - as, again,
the example does not have anything here!
I am lost and desperate to get this going - spent far too much time on
it already!

Thanks - any suggestions very welcome :eek:)

Tim
 
G

Guest

Tim,
Your ProcessRequest method doesn't "do" anything - it's just a method
signature with no code or logic in the body. Go back and re-read the article
you mention, or find a similar one.
Peter
 
T

Tim

Hi Peter

I am aware that my method doesn;t do anything, but I should be able to
hit a breakpoint on the method header. - I can on the example i have
got.

Tim
 

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

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top