473,569 Members | 2,601 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.H tmlTextWriter)
output.Write(St ring.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 1138
"Galore" <ga****@ig.com. br> wrote in message
news:OR******** ******@tk2msftn gp13.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.H tmlTextWriter)
output.Write(St ring.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
johnwsaundersii i at hotmail

Nov 18 '05 #2
Hi,

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

if you want to change the HTML presentation of control at design time
you should override ControlDesigner GetDesignTimeHt ml 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.Desi gnMode) should return indication if control in
DesignMode.

if you want to change the HTML presentation of control at design time
you should override ControlDesigner GetDesignTimeHt ml 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
2316
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 it works perfectly (even it doesn't stop loading the page, but this doesn't matter), but the whole IE crashes and shuts down itself without reason....
2
7482
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 controls in a form (or another control), the designer likes to "touch" each of my custom properties -- either by trying to "set" it to a default value...
1
4924
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 when my control is in design or Runtime mode, it´s work, but when this usercontrol is put in another usercontrol the DesignMode property always...
2
5946
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 open in Designmode. To set correctly the properties when changed in the property-browser while designing I need to know if the control is in...
29
5057
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 (New) which does the MyBase.New() thing and then InitializeComponent().
1
2196
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
2270
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 FF version (the else branch) works fine but the if branch (IE) switches into design Mode but wont switch back. Below is my method, the iFrame...
4
1464
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. There was a suggestion... Protected Shadows ReadOnly Property DesignMode() As Boolean Get If (MyBase.DesignMode) Then Return True
2
4475
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 (LicenseManager.UsageMode == LicenseUsageMode.Designtime) b_designMode = true;
0
7701
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7615
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8130
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7677
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6284
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5219
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3643
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1223
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.