Hi I use User-Controls in my ASP.Net (3.5) pages to simulate popups (Visual-Studio 2008).
The problem is that all these popups are positioned over the normal controls in the page in design mode.
So my Question is: How can I hide User-Controls in Design-Mode.
views:
443answers:
1
A:
From googling around a bit I don't think you can with an ascx. I think you should turn it into a custom control if you need this.
http://www.west-wind.com/WebLog/posts/189.aspx might help
edit: http://ajdotnet.wordpress.com/2006/08/28/do-you-value-design-time-support/
you might be able to do this if you create a custom control that holds an instance of your user control, and uses the method linked to above to hide all its content.
mcintyre321
2009-11-23 09:22:45
As far as I can see this explains how to customize the designer of a component, but I can't see how to entirely hide a user control in the designer view.
David Feurle
2009-11-23 10:57:25
thanks for your help! I saw this post earlier. I tried the solution exactly as posted there but the popups still appear.
David Feurle
2009-11-23 13:00:04
even throwing an exception in the render function (unconditionally and always) does not prevent the user control from beeing rendered!
David Feurle
2009-11-23 15:04:55
I think VS just strips out the code blocks and puts the text from the ascx file into the designer (rendering any non-user controls), no render at all. That means you are stuck if you use a UserControl
mcintyre321
2009-11-23 16:25:04