HTTPModules

  • Thread starter Thread starter David Jessee
  • Start date Start date
D

David Jessee

Does anyone know if there's a way to register a HTTPModule at runtime?

One of the big reasons we use them is to create graphics on the fly. I have
a calendar control that allows the developer to specify an image to activate
the calendar. I was thinking that it would be great if that control could
dynamicly register a module that rendered any one of 3 or 4 images. From a
configuration standpoint, the developer would just have to plop the control
(yeah, technical terminology) on the web form and the control would register
the image HTTPModule with the web application if it didn't already exist.
 
Hi David,

Short answer is: no, there is no configuration APIs you can call to
programmatically register a module.

Long answer is: you could write a VS.NET addin, that you install @ your
product's installation time. This addin will be checking the current
projects references, and if it detects that your product's assembly is
referenced it will modify the current project's web.config file accordingly.
You could even check if the dev is actually using the control that requires
the module to be registered and modify the web.config only in this case.

--
Victor Garcia Aprea
Microsoft MVP | ASP.NET
Looking for insights on ASP.NET? Read my blog:
http://obies.com/vga/blog.aspx
To contact me remove 'NOSPAM'. Please post all questions to the newsgroup
 
Great idea!
Granted, I was actually hoping that there was a way to do it at runtime,
because there are a couple other applications of this type of thing that I
was trying to figure out. But this will get me a lot farther than I was.
 
Back
Top