|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Telling weither the control is in design time or on a web pageHello,
I have a web control and I want to render it differnetly when it is in design mode as aposed to when it is on a web page. How do I tell when it is in the different mode? Any help would be good Kind regards Greg You could try putting the changes that you want in somehting like the
page_load event. Then those changes won't be apparent at design time, but will show up at run time. Doug Show quoteHide quote "GregO" wrote: > Hello, > I have a web control and I want to render it differnetly when it is in > design mode as aposed to when it is on a web page. > > How do I tell when it is in the different mode? > > Any help would be good > > Kind regards > Greg > > > You can establish a control designer for your custom control. A control designer
is what emits the HTML to be shown in VS.NET's design view. Also in v2.0 they added a DesignMode bool property to let you know if you are in the designer. -Brock http://staff.develop.com/ballen Show quoteHide quote > Hello, > I have a web control and I want to render it differnetly when it is in > design mode as aposed to when it is on a web page. > How do I tell when it is in the different mode? > > Any help would be good > > Kind regards > Greg When you say web control I imagine you're talking about web server controls
and not user controls. Any way, I had a similar issue and I came up with this idea: Public Sub New() _IsDevEnvironment = (System.Diagnostics.Process.GetCurrentProcess().MainModule.ModuleName = "devenv.exe") End Sub This will let you know if the process accessing the control is devenv.exe or not. Note: this will only work with vs2003 as I do not know what the new name of the process for 2005 is called. I'm not sure if this has a hit on performance or not and how big that hit will be. Show quoteHide quote "GregO" wrote: > Hello, > I have a web control and I want to render it differnetly when it is in > design mode as aposed to when it is on a web page. > > How do I tell when it is in the different mode? > > Any help would be good > > Kind regards > Greg > > >
asp.net 2.0 treeview control - very slow
treeview asp.net 2.0 Menu Control - SubItem Shadows How do I reference or change formview child controls in code? Flickering imagebutton with smartnavigation on Any Help on TabStrip Control?? Gridview hypterlink colomn to popup a new window disabling back button of window Calendar control question AxWebBrowser & POSTing forms |
|||||||||||||||||||||||