Sample HttpHandler Code
Messages   Related Types
This message was discovered on ASPFriends.com 'aspnghttphandlers' list.


John Shipway
-- This message, which was originally sent to "aspngbeta", has been copied to "aspnghttphandlers" mailing list by the List Master --

Hello,

Does anyone have a sample code for a custom HttpHandler class?

Upon compiling the following:

Public Class MyHttpHandler=20
    Implements System.Web.HttpHandler=20

    Public Readonly Property IsReusable() As Boolean=20
        Get=20
            Return True=20
        End Get=20
    End Property=20
=09
    Public Sub ProcessRequest(byval context as
System.Web.HttpContext)=20
        'custom code here=20
    End Sub
End Class=20
=20
I get the following error messages:
=20
Type test.MyHttpHandler needs to implement Overridable Readonly property
IsResuable() as Boolean=20
Type test.MyFusiHttpHandler needs to implement Overridable Sub
ProcessRequest(context as System.Web.HttpContext)=20
=20
I have tried the VB6 Implements syntax (Interface_MethodName) and that
did not work either. Any ideas?

Thanks,

John
=20

Reply to this message...
 
    
Stuart C. Salsbury
-- This message, which was originally sent to "aspngbeta", has been moved to "aspnghttphandlers" mailing list by the List Master --

I think the example code fails to compile because it does not appear to
indicate that the IsReusable property and the ProcessRequest method are
implementations on the IHttpHandler interface (thus the compiler thinks that
you haven't fully implemented the IHttpHandler interface).

I've been using C# and haven't learned vb.net at all, nor having I tested
the following...

but I've added "Implements ... " to the method declarations that you
provided and put the code below my sig.. I hope this helps.

Regards,
Stuart Salsbury
Ernst & Young LLP

'**************************************************************
Public Readonly Property IsReusable Implements
System.Web.IHttpHandler.IsReusable() As Boolean
Get
Return True
End Get
End Property

Public Sub ProcessRequest Implements
System.Web.IHttpHandler.ProcessRequest(byval context as
System.Web.HttpContext)
'custom code here
End Sub
'**************************************************************

-----Original Message-----
From: John Shipway [mailto:Click here to reveal e-mail address]
Sent: Wednesday, May 09, 2001 10:48 AM
To: aspngbeta
Subject: [aspngbeta] Sample HttpHandler Code

Hello,

Does anyone have a sample code for a custom HttpHandler class?

Upon compiling the following:

Public Class MyHttpHandler
Implements System.Web.HttpHandler

Public Readonly Property IsReusable() As Boolean
Get
Return True
End Get
End Property

Public Sub ProcessRequest(byval context as
System.Web.HttpContext)
'custom code here
End Sub
End Class

I get the following error messages:

Type test.MyHttpHandler needs to implement Overridable Readonly property
IsResuable() as Boolean
Type test.MyFusiHttpHandler needs to implement Overridable Sub
ProcessRequest(context as System.Web.HttpContext)

I have tried the VB6 Implements syntax (Interface_MethodName) and that
did not work either. Any ideas?

Thanks,

John

Reply to this message...
 
 
System.Web.HttpContext
System.Web.IHttpHandler




Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
 
 Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us - Terms of Use - Privacy Policy - www.dotnet247.com