473,320 Members | 1,845 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

DesignMode for webforms...

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!
Nov 18 '05 #1
3 1123
"Galore" <ga****@ig.com.br> wrote in message
news:OR**************@tk2msftngp13.phx.gbl...
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/de...-us/cpguide/ht
ml/cpcondesign-timeforwebforms.asp) .
--
John Saunders
johnwsaundersiii at hotmail

Nov 18 '05 #2
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!
Nov 18 '05 #3
It's worked, that's why I love newsgroups, lots of knowledge!!!

Thanks, Natty

Natty Gur wrote:
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!

Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Thomas | last post by:
Hy dudes, I have a strange problem. I dynamically create an IFrame with JavaScript and then fill in some content. Afterwards I want to switch to designMode. There the trouble starts. In Mozilla...
2
by: Lecture Snoddddgrass | last post by:
Hi, When I create a UserControl-derived object, I often expose various public properties. One of the things that I hate about the WinForms designer is that if I decide to embed one of these...
1
by: Tiago Barbutti | last post by:
I have a UserControl that execute methods in Load event, but it hapens in designMode and generate an error and the control disappear from the form. I read that i can use the DesignMode to kwnow...
2
by: Malleier Alfred | last post by:
Hi, what does the Me.DesignMode-Property turn back. I tried to set a MsgBox(Me.DesignMode) in my form's and control's Sub New(), but it allways turns back 'false', even if the form or control is...
29
by: Charles Law | last post by:
Further to my issue about user controls, I have a problem with DesignMode. Here is the project hierarchy: MainApp |_ Project1 |_ SubProject (UserControl) SubProject has a default constructor...
1
by: Paul W | last post by:
I'm having trouble detecting whether my Control is in DesignMode. I'm deriving a class from TreeView; Public Class ExplorerView Inherits TreeView ... End Class
2
by: Simon Rigby | last post by:
Hi folks, I'm trying to switch an iFrame in and out of design mode by way of a script. As you can see from the method it is intended to be cross browser compatible (or FF and IE at least). The...
4
by: Kyjan | last post by:
Greetings! In doing some research, I've learned that some other people have had problems with Me.DesignMode not working correctly when it's used in a user control that is placed on another form....
2
by: graeme g | last post by:
ii i've been developing some usercontrols... and sudden the property designmode no longer works.. if i test it value at designtime it always comes back false... i've made a work around if...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.