468,309 Members | 1,109 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

Add HttpHandlers Programmatically

I have this web control that need to process some special
urls requested by the browser. So I created a class
implementing IHttpHandler to deal with it.
The problem here is that to properly use the control, the
developer has to include something like the following in
his web.config:

<httpHandlers>
<add verb="*" path="MySpecialResource.ashx"
type="MyRequestHandler, MyAssembly"/>
</httpHandlers>

My goal is to simplify as much as I can the usage of the
control, trying to make it as drag n'drop as possible.
So the question would be: Is there a way to
programmatically add HttpHandlers to an ASP.NET
application ?
Or, should I be using something else ?

Thanks

TJ
Nov 18 '05 #1
1 2092
TJoker .NET wrote:
I have this web control that need to process some special
urls requested by the browser. So I created a class
implementing IHttpHandler to deal with it.
The problem here is that to properly use the control, the
developer has to include something like the following in
his web.config:

<httpHandlers>
<add verb="*" path="MySpecialResource.ashx"
type="MyRequestHandler, MyAssembly"/>
</httpHandlers>

My goal is to simplify as much as I can the usage of the
control, trying to make it as drag n'drop as possible.
So the question would be: Is there a way to
programmatically add HttpHandlers to an ASP.NET
application ?
Or, should I be using something else ?


I'm not very experienced in this area, but you probably should look at
VS.NET's design-time support for controls (and possible the IDE's object
model for extensibility).

Look at the documentation for "Enhancing Design-Time Support". This
documents how controls can get notification of events when they are
selected, dropped, etc.

You might also need to look at the "Automation and Extensibility
Reference" which provides an object model for VS.NET's solutions and
projects (among other things).

Once again, I'm not experienced in this, but I think a possible approach
is to use the functionality in the System.ComponentModel.Design
namespace to get notification of when your control is added, then use
the VS.NET automation model to get to the project's web.config file and
add your stuff.

--
mikeb
Nov 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by some guy with a computer | last post: by
reply views Thread by Chance Hopkins | last post: by
1 post views Thread by Patrick Kristiansen | last post: by
4 posts views Thread by Grant Harmeyer | last post: by
reply views Thread by tshad | last post: by
5 posts views Thread by Anonieko | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.