473,387 Members | 1,882 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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 2252
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: some guy with a computer | last post by:
I can not get a custom httpHandler to fire using machine.config and an assembly in the GAC. It will not work if I move the assembly to the GAC, even though I have it referenced correctly and add...
2
by: Luis | last post by:
Hi, I want to protected all files in my website, so I try to use httpHandlers, I put this in my WEB.CONFIG (at the end of page), but I can't protected the files type MDB, CSB, can someone help...
0
by: Chance Hopkins | last post by:
Does anyone know how to get a custom httpHandler to fire for all applications in machine.config for an assembly in the GAC, without using seperate location tags? For instance, this works for a...
1
by: Patrick Kristiansen | last post by:
Hi! I have on my website a root web.config file, and also created a subapplication "/publikationer". In my root web.config I've specified an HTTP-handler for some requests, but this is mirrored...
4
by: Grant Harmeyer | last post by:
How would I set up an httpHandler so that it would only apply to certain child directories of the application? I.E: <httpHandlers> <add verb="*" path="/files/*/*/*/*.aspx"...
3
by: MWells | last post by:
I'm having an issue getting my HttpHandlers and HttpModules to play together nicely. My HttpHandlers take special document types (defined by extension) and process them specially. I might have...
0
by: yma | last post by:
Hi, I have a web.config file that contains <httpHandlers> section that causes "cannot load file..." error. If I delete this section, it is OK. Why did vb.net add this section? It does not add...
0
by: tshad | last post by:
I have 2 controls that I need to run that I got of the Web. I have been using ScrollKeeper for awhile and was trying to add FreeTextBox to my site. But for some reason it won't run if ScrollKeeper...
5
by: Anonieko | last post by:
HttpHandlers - Learn Them. Use Them. Introduction There are many features in ASP.NET that are unfortunately underused. Sometimes a feature gets looked over because it's too complicated....
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.