Programatically adding an HTTPHandler

  • Thread starter Steve C. Orr [MVP, MCSD]
  • Start date
S

Steve C. Orr [MVP, MCSD]

When my custom control is dropped onto a web page at design time, I want an
associated HTTPHandler reference to be automatically added to the project's
web.config file if it's not already there.
I see some other controls do this, such as the ReportViewer control so I
know it is possible. But how is it done? Does anybody know?
 
C

CaffieneRush

I haven't tried this yet but how about overriding the Initialize method
of the ControlDesigner associated with your control and modifying the
reference in web.config?

The MSDN sample 'How to: Use Services and Action Lists with Control
Designers' contains code on how to access web.config from the VS host
environment.

Some of the class code are missing on the online docs. So look at the
docs installed with VS rather than the docs @ msdn2.microsoft.com.

By the way, debugging control designers requires 2 instances of VS. One
instance to run the designer and another to debug the original
instance.

Regards,
Andy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top