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
Steve C. Orr [MVP, MCSD] wrote:
Quote:
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? |