Hi
Sorry, don't know how to phrase the question any better.
Within Visual Studio I have a style sheet that being dynamically
added to the code, i.e. not via the html page. I want to place this
within
a html page so that the VS designer can see the style sheet but the
running
executable can't
#ifdef RUNNING_IN_VS
// include the style sheet
#endif
I also want to do the same thing within user controls. If their
running
in an executable I want them to do different things compared to if
their
having their properties examined via the call:
ComponentDesigner::InitializeInheritedProperties
I can think of contrived ways of doing this, having a UserControl
with a
property 'Running' which the executable sets but obviously VS won't
but I'd rather a cleaner way of doing it.
Thanks
F 6 1296
F,
The way I would do this is check for HttpApplication.Context. This will be
null if you are in the designer.
Jim Cheshire, MCSE, MCSD [MSFT]
Developer Support
ASP.NET ja******@online.microsoft.com
This post is provided as-is with no warranties and confers no rights.
-------------------- From: fo******@yahoo.co.uk Newsgroups: microsoft.public.dotnet.framework.aspnet Subject: Does VS have a 'if running in studio' flag? Date: 2 Dec 2003 04:10:17 -0800 Organization: http://groups.google.com Lines: 29 Message-ID: <ac**************************@posting.google.com > NNTP-Posting-Host: 195.224.69.50 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1070367018 24954 127.0.0.1 (2 Dec 2003
12:10:18 GMT)X-Complaints-To: gr**********@google.com NNTP-Posting-Date: Tue, 2 Dec 2003 12:10:18 +0000 (UTC) Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed 00.sul.t-online.de!t-onlin
e.de!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!postnew s1.google.com!no
t-for-mailXref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:194425 X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
Hi Sorry, don't know how to phrase the question any better. Within Visual Studio I have a style sheet that being dynamically added to the code, i.e. not via the html page. I want to place this within a html page so that the VS designer can see the style sheet but the running executable can't
#ifdef RUNNING_IN_VS // include the style sheet #endif
I also want to do the same thing within user controls. If their running in an executable I want them to do different things compared to if their having their properties examined via the call:
ComponentDesigner::InitializeInheritedPropertie s
I can think of contrived ways of doing this, having a UserControl with a property 'Running' which the executable sets but obviously VS won't but I'd rather a cleaner way of doing it.
Thanks F
> The way I would do this is check for HttpApplication.Context. This will be null if you are in the designer.
Will this work from a static method?
Foldface,
I haven't explicitly tested this in a static method, but I'm sure it will
work.
Jim Cheshire, MCSE, MCSD [MSFT]
Developer Support
ASP.NET ja******@online.microsoft.com
This post is provided as-is with no warranties and confers no rights.
-------------------- From: fo******@yahoo.co.uk Newsgroups: microsoft.public.dotnet.framework.aspnet Subject: Re: Does VS have a 'if running in studio' flag? Date: 8 Dec 2003 07:47:55 -0800 Organization: http://groups.google.com Lines: 4 Message-ID: <ac**************************@posting.google.com > References: <ac**************************@posting.google.com >
<wd**************@cpmsftngxa06.phx.gbl>NNTP-Posting-Host: 195.224.69.50 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1070898475 16119 127.0.0.1 (8 Dec 2003
15:47:55 GMT)X-Complaints-To: gr**********@google.com NNTP-Posting-Date: Mon, 8 Dec 2003 15:47:55 +0000 (UTC) Path:
cpmsftngxa07.phx.gbl!cpmsftngxa06.phx.gbl!TK2MSFTN GP08.phx.gbl!newsfeed00.su
l.t-online.de!newsfeed01.sul.t-online.de!t-online.de!fu-berlin.de!postnews1.
google.com!not-for-mailXref: cpmsftngxa07.phx.gbl microsoft.public.dotnet.framework.aspnet:195093 X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
The way I would do this is check for HttpApplication.Context. This will
be null if you are in the designer.
Will this work from a static method?
> I haven't explicitly tested this in a static method, but I'm sure it will work.
Sorry but how do you do this? Via Application["Context"]? That
doesn't seem to work? Can you give me just a quick noddy example,
about 3 lines worth?
Thanks
F
> Sorry but how do you do this?
Just to answer my own question
if(Context == null)
Yes, that's right. Sorry. I've been out of the office for several days.
Jim Cheshire, MCSE, MCSD [MSFT]
Developer Support
ASP.NET ja******@online.microsoft.com
This post is provided as-is with no warranties and confers no rights.
-------------------- From: fo******@yahoo.co.uk Newsgroups: microsoft.public.dotnet.framework.aspnet Subject: Re: Does VS have a 'if running in studio' flag? Date: 11 Dec 2003 08:00:43 -0800 Organization: http://groups.google.com Lines: 5 Message-ID: <ac**************************@posting.google.com > References: <ac**************************@posting.google.com >
<wd**************@cpmsftngxa06.phx.gbl>
<ac**************************@posting.google.com >
<e8**************@cpmsftngxa07.phx.gbl>
<ac**************************@posting.google.com >NNTP-Posting-Host: 195.224.69.50 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1071158443 16361 127.0.0.1 (11 Dec 2003
16:00:43 GMT)X-Complaints-To: gr**********@google.com NNTP-Posting-Date: Thu, 11 Dec 2003 16:00:43 +0000 (UTC) Path:
cpmsftngxa07.phx.gbl!cpmsftngxa10.phx.gbl!TK2MSFTN GXA06.phx.gbl!TK2MSFTNGXA0
5.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-online.de!news-s
pur1.maxwell.syr.edu!news.maxwell.syr.edu!postnews 1.google.com!not-for-mailXref: cpmsftngxa07.phx.gbl microsoft.public.dotnet.framework.aspnet:195801 X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
Sorry but how do you do this?
Just to answer my own question
if(Context == null) This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Eric Mamet |
last post by:
Everytime I try to look at a web user control in design mode, Visual
Studio prompts me for checking out the file from Visual Source Safe.
Apparently, it just shuffles around the first three lines...
|
by: Will Chamberlain |
last post by:
I came across a rather interesting article this morning and thought I'd
share. We all know that Visual Studio is a great IDE, but I think we can
all agree that it is adds a dramatic change to how...
|
by: jmespinosabaviera |
last post by:
1) Does visual studio standard 2005 include visual basic ?.
2) What difference is there between the visual studio standard 2005 and
the professional version ?
3) What difference is there...
|
by: Russell Mangel |
last post by:
Maybe someone could explain something that has been bothering me.
I noticed that when I create a class library, and then access the class
instance's member variables (from client), using the...
|
by: Wanjun Yu |
last post by:
Does Visual Studio 2005 work with Source Safe 6.0? Thanks.
Wanjun
|
by: Warren |
last post by:
I am running win2k pro and was wondering if writing python scripts or
running modules dumps anything in the "C" drive? I have 3 partitions
and run python on the 3rd one or "E"drive.
My "C" drive...
|
by: Sard |
last post by:
http://rgruet.free.fr/PQR25/PQR2.5.html says
"Optimize generated bytecode (also PYTHONOPTIMIZE=x). Asserts are
suppressed."
Is removing asserts all it does, where can I find more details? I'm...
|
by: meejayant |
last post by:
Please let me know whether window vista supports visual studios 2005 and sql 2005.
Its very urgent.
|
by: Rachel Garrett |
last post by:
This is driving me mad. I have Visual Studio.NET PRO 2005 installed on
my machine at work. I want to write a web service. I find lots of
tutorials on how to do this with Visual Studio.NET; some are...
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
| |