468,272 Members | 2,016 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,272 developers. It's quick & easy.

HttpModule causing HttpHandler not to work

I am trying to get an HttpHandler I found on the Web to work. It is called
FreeText. It allows fancy handling of a Textbox.

This program is just a dll that you set up as an HttpHandler:

<httpHandlers>
<add verb="GET"
path="FtbWebResource.axd"
type="FreeTextBoxControls.AssemblyResourceHandler, FreeTextBox"
/>
</httpHandlers>

This program works fine as long as I don't add a rudimentary HttpModule. I
found out it doesn't work if I have a module called ScrollKeeper installed.

I get an error:

Problems with this Web Page might prevent it from being displayed
properly.

Then I found that it had nothing to do with that program. I could make it
fail if I just added a basic module of my own.

************************************************** *************
using System;
using System.Web;

namespace HttpModuleExamples
{
public class CustomHttpModule : IHttpModule
{
//IHttpModule Members
public void Init(HttpApplication httpApp)
{
httpApp.EndRequest += new EventHandler(this.OnEndRequest);
}
public void Dispose()
{
//Usually nothing has to happen here
}

// Event Handlers
public void OnEndRequest(object o, EventArgs ea)
{
HttpApplication httpApp = (HttpApplication) o;
HttpContext ctx = HttpContext.Current;
ctx.Response.Write("<br>Ending Request <br>");
}
}
}
************************************************** ************

My Web.Config entry:

<httpModules>
<add type="HttpModuleExamples.CustomHttpModule, HttpModules"
name="CustomHttpModule" />
</httpModules>
If I take out the "ctx.Response.Write" line, it works fine.

Why would that affect the other dll?

Thanks,

Tom
Mar 1 '06 #1
0 1026

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Peter Rilling | last post: by
3 posts views Thread by Michael Iantosca | last post: by
reply views Thread by Mike Schilling | last post: by
reply views Thread by tshad | last post: by
2 posts views Thread by Roshawn | last post: by
3 posts views Thread by Guzeppi | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.