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


John Shipway
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...
 
    
Mike Amundsen
here's a simple C# handler:

using System.Web;

public class HelloWorldHandler : IHttpHandler {

public void ProcessRequest(HttpContext context) {

HttpRequest Request = context.Request;
HttpResponse Response = context.Response;

Response.Write("<html>");
Response.Write("<body>");
Response.Write(" <h1> Hello " + Request.QueryString["Name"] +
"</h1>");
Response.Write("</body>");
Response.Write("</html>");
}

public bool IsReusable() {
return true;
}
}

MCA

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

| [aspngbeta] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngbeta.asp = JOIN/QUIT

Reply to this message...
 
 
System.Web.HttpContext
System.Web.HttpRequest
System.Web.HttpResponse
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