Search:
Namespaces
Discussions
.NET v1.1
Feedback
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
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