.NETGURU
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




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification