views:

25

answers:

2

I render some markup dynamically in a Web User Control, can I get that out in design mode, and not only runtime?

public override void RenderControl(HtmlTextWriter writer)
{
 if (this.DesignMode) 
  writer.Write("<p>In design mode</p>");
 else
  base.RenderControl(writer);
}

... nothing happens when I check the design view of the control. Not if I remove the if (this.DesignMode)-condition either.

Will I need to use a Server Control?

+1  A: 

You will need to create a custom designer for your control. Start reading about it on MSDN

TheGeekYouNeed
+1  A: 

It is not possible with a Control deriving from UserControl. Also see http://stackoverflow.com/questions/3669582/how-to-hide-the-inner-controls-of-a-usercontrol-in-the-designer

citronas