views:

286

answers:

2

Is it possible to get design mode to work for templated user controls? I have tried following the How to: Create Templated ASP.NET User Controls on MSDN, and also tried the various tips at the bottom of page for version 2.0 of the framework, but alas, I still get the dreaded "Error creating user control" error, when switching to design view.

Should I just give up, and switch to a custom server control?

A: 

I was never able to get it to work either. It can be done easily with a regular server control, though. I posted a quick example as an answer to this question: http://stackoverflow.com/questions/1650525/asp-net-user-control-with-access-to-the-controls-that-it-wraps/1681958#1681958

Matthew
+2  A: 

There is a Connect bug filed on this as well as several comments on the VS2005 version of the MSDN page. Apparently this is a long-running defect that hasn't been fixed and hasn't got a solution. In ScottGu's post about this feature, he acknowledges this doesn't work (in the comments) and points the commenters to the CompositeControl base class if they want designer support.

Probably not the answer you were hoping for, but it sounds like there's no real solution for the issue except moving to server controls.

Travis Illig