DesignMode for webforms...

  • Thread starter Thread starter Galore
  • Start date Start date
G

Galore

Hello,

In winforms, we had the DesignMode property, to know when we're
developing code or executing the application. I wonder if is there
something similar in webforms.

I need to write a webcontrol, but when I'm in design mode, I wish the
webcontrol rendering only its name:

Protected Overrides Sub Render(ByVal output As
System.Web.UI.HtmlTextWriter)
output.Write(String.Empty)
End Sub

And when it is being executed, I wish the webcontrol does not send
String.Empty to the Write method.

Any clue?

Thanks a lot!
 
Galore said:
Hello,

In winforms, we had the DesignMode property, to know when we're
developing code or executing the application. I wonder if is there
something similar in webforms.

I need to write a webcontrol, but when I'm in design mode, I wish the
webcontrol rendering only its name:

Protected Overrides Sub Render(ByVal output As
System.Web.UI.HtmlTextWriter)
output.Write(String.Empty)
End Sub

And when it is being executed, I wish the webcontrol does not send
String.Empty to the Write method.

Any clue?

Take a look at
Design-Time Support for Web Forms
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/ht
ml/cpcondesign-timeforwebforms.asp) .
 
Hi,

Pages implement Isite therefore DesignMode property
(this.site.DesignMode) should return indication if control in
DesignMode.

if you want to change the HTML presentation of control at design time
you should override ControlDesigner GetDesignTimeHtml Method.

HTH

Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377


*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Back
Top