By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,300 Members | 1,867 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,300 IT Pros & Developers. It's quick & easy.

Add HttpHandlers Programmatically

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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.