Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Determining control behaviour at design-time/run-time

Thread Tools

Determining control behaviour at design-time/run-time

Paul Cook
Posts: n/a

I am trying to determine whether a control is being displayed at
designtime or runtime but this piece of code doesn't seem to work
correctly. Note that this is not a web user control (ascx) although
this control does end up being used on an ascx control.

The expression always evaluates false (the else part - runtime!)

public class AccountDropDownList :
public AccountDropDownList()
if(Site != null && Site.DesignMode)
this.Items.Add(new ListItem("Design time"));
this.Items.Add(new ListItem("Run time"));

Any help would be greatly appreciated, Paul.
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
debugger behaviour different to execution behaviour Andy Chambers Java 1 05-14-2007 09:51 AM
Determining control that caused a postback =?Utf-8?B?ZGNoaWxsbWFu?= ASP .Net 4 10-19-2005 12:28 PM
Determining What Control Caused The PostBack Nathan Sokalski ASP .Net 5 09-05-2005 10:42 PM
Determining if a textbox control caused a postback RTM ASP .Net 4 01-20-2004 05:49 PM
Determining the height of a control? Greg Hurlman ASP .Net 0 07-30-2003 02:44 PM