How to judge whether it is under the design mode?

Discussion in 'ASP .Net Web Controls' started by Laser Lu, Jun 1, 2004.

  1. Laser Lu

    Laser Lu Guest

    I want to judge whether it is currently under the design mode in the code when I was developing a web control. The question is how to achieve it? Is there any property that indicates the current mode the code was runnig under?
     
    Laser Lu, Jun 1, 2004
    #1
    1. Advertising

  2. Hi,

    One way to do this is to check HttpContext.Current. If it's null, you are
    in design mode.

    Jim Cheshire, MCSE, MCSD [MSFT]
    ASP.NET
    Developer Support


    This post is provided "AS-IS" with no warranties and confers no rights.

    --------------------
    >Thread-Topic: How to judge whether it is under the design mode?
    >thread-index: AcRH0ByXWCzwZIgNTv+AOISpBL1/pw==
    >X-WN-Post: microsoft.public.dotnet.framework.aspnet.webcontrols
    >From: "=?Utf-8?B?TGFzZXIgTHU=?=" <>
    >Subject: How to judge whether it is under the design mode?
    >Date: Tue, 1 Jun 2004 05:01:03 -0700
    >Lines: 1
    >Message-ID: <>
    >MIME-Version: 1.0
    >Content-Type: text/plain;
    > charset="Utf-8"
    >Content-Transfer-Encoding: 7bit
    >X-Newsreader: Microsoft CDO for Windows 2000
    >Content-Class: urn:content-classes:message
    >Importance: normal
    >Priority: normal
    >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    >Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
    >Path: cpmsftngxa10.phx.gbl
    >Xref: cpmsftngxa10.phx.gbl

    microsoft.public.dotnet.framework.aspnet.webcontrols:21065
    >NNTP-Posting-Host: tk2msftcmty1.phx.gbl 10.40.1.180
    >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
    >
    >I want to judge whether it is currently under the design mode in the code

    when I was developing a web control. The question is how to achieve it? Is
    there any property that indicates the current mode the code was runnig
    under?
    >
     
    Jim Cheshire [MSFT], Jun 1, 2004
    #2
    1. Advertising

  3. Laser Lu

    Laser Lu Guest

    A further question: How to get the file path of the current editing aspx page

    ----- Jim Cheshire [MSFT] wrote: ----

    Hi,

    One way to do this is to check HttpContext.Current. If it's null, you are
    in design mode

    Jim Cheshire, MCSE, MCSD [MSFT
    ASP.NE
    Developer Suppor


    This post is provided "AS-IS" with no warranties and confers no rights

    -------------------
    >Thread-Topic: How to judge whether it is under the design mode
    >thread-index: AcRH0ByXWCzwZIgNTv+AOISpBL1/pw=
    >X-WN-Post: microsoft.public.dotnet.framework.aspnet.webcontrol
    >From: "=?Utf-8?B?TGFzZXIgTHU=?=" <>>Subject: How to judge whether it is under the design mode
    >Date: Tue, 1 Jun 2004 05:01:03 -070
    >Lines:
    >Message-ID: <>>MIME-Version: 1.
    >Content-Type: text/plain
    > charset="Utf-8
    >Content-Transfer-Encoding: 7bi
    >X-Newsreader: Microsoft CDO for Windows 200
    >Content-Class: urn:content-classes:messag
    >Importance: norma
    >Priority: norma
    >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.
    >Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrol
    >Path: cpmsftngxa10.phx.gb
    >Xref: cpmsftngxa10.phx.gbl

    microsoft.public.dotnet.framework.aspnet.webcontrols:2106
    >NNTP-Posting-Host: tk2msftcmty1.phx.gbl 10.40.1.18
    >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrol
    >>I want to judge whether it is currently under the design mode in the code

    when I was developing a web control. The question is how to achieve it? Is
    there any property that indicates the current mode the code was runnig
    under
    >
     
    Laser Lu, Jun 2, 2004
    #3
  4. Laser Lu

    Laser Lu Guest

    I'm now developing a web control. However, some information necessary to render the control is unavailable at design time. So I have to get accessed to the design time object model of the IDE, in order to find a alternative information. Then how to access the design time object model?
     
    Laser Lu, Jun 2, 2004
    #4
  5. Laser Lu

    Laser Lu Guest

    For example, if I want to get the information of the currently editting aspx file, then how to do it

    ----- Laser Lu wrote: ----

    I'm now developing a web control. However, some information necessary to render the control is unavailable at design time. So I have to get accessed to the design time object model of the IDE, in order to find a alternative information. Then how to access the design time object model?
     
    Laser Lu, Jun 2, 2004
    #5
  6. Laser,

    What information specifically are you looking for?

    Jim Cheshire, MCSE, MCSD [MSFT]
    ASP.NET
    Developer Support


    This post is provided "AS-IS" with no warranties and confers no rights.

    --------------------
    >Thread-Topic: How to judge whether it is under the design mode?
    >thread-index: AcRITSPDHSBJmcOISGmBgOvOF0BBKA==
    >X-WN-Post: microsoft.public.dotnet.framework.aspnet.webcontrols
    >From: "=?Utf-8?B?TGFzZXIgTHU=?=" <>
    >References: <>

    <>
    >Subject: RE: How to judge whether it is under the design mode?
    >Date: Tue, 1 Jun 2004 19:56:02 -0700
    >Lines: 5
    >Message-ID: <>
    >MIME-Version: 1.0
    >Content-Type: text/plain;
    > charset="Utf-8"
    >Content-Transfer-Encoding: 7bit
    >X-Newsreader: Microsoft CDO for Windows 2000
    >Content-Class: urn:content-classes:message
    >Importance: normal
    >Priority: normal
    >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    >Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
    >Path: cpmsftngxa10.phx.gbl
    >Xref: cpmsftngxa10.phx.gbl

    microsoft.public.dotnet.framework.aspnet.webcontrols:21086
    >NNTP-Posting-Host: tk2msftcmty1.phx.gbl 10.40.1.180
    >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
    >
    >For example, if I want to get the information of the currently editting

    aspx file, then how to do it?

    ----- Laser Lu wrote: -----

    I'm now developing a web control. However, some information necessary
    to render the control is unavailable at design time. So I have to get
    accessed to the design time object model of the IDE, in order to find a
    alternative information. Then how to access the design time object model?
    >
     
    Jim Cheshire [MSFT], Jun 4, 2004
    #6
  7. Laser Lu

    Laser Lu Guest

    For example, I want to get the file path of the currently editing aspx page in code. Is that possible?
     
    Laser Lu, Jun 6, 2004
    #7
  8. Hi,

    Yes, it is possible via extensibility. DTE.ActiveDocument.FullName will
    return the path to the document currently being edited.

    Jim Cheshire, MCSE, MCSD [MSFT]
    ASP.NET
    Developer Support


    This post is provided "AS-IS" with no warranties and confers no rights.

    --------------------
    >Thread-Topic: How to judge whether it is under the design mode?
    >thread-index: AcRLpX3M2N4CeykVQk6vSMjOWxuWXA==
    >X-WN-Post: microsoft.public.dotnet.framework.aspnet.webcontrols
    >From: "=?Utf-8?B?TGFzZXIgTHU=?=" <>
    >References: <>

    <>
    <>
    <>
    >Subject: RE: How to judge whether it is under the design mode?
    >Date: Sun, 6 Jun 2004 02:06:02 -0700
    >Lines: 1
    >Message-ID: <>
    >MIME-Version: 1.0
    >Content-Type: text/plain;
    > charset="Utf-8"
    >Content-Transfer-Encoding: 7bit
    >X-Newsreader: Microsoft CDO for Windows 2000
    >Content-Class: urn:content-classes:message
    >Importance: normal
    >Priority: normal
    >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    >Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
    >Path: cpmsftngxa10.phx.gbl
    >Xref: cpmsftngxa10.phx.gbl

    microsoft.public.dotnet.framework.aspnet.webcontrols:21193
    >NNTP-Posting-Host: tk2msftcmty1.phx.gbl 10.40.1.180
    >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
    >
    >For example, I want to get the file path of the currently editing aspx

    page in code. Is that possible?
    >
     
    Jim Cheshire [MSFT], Jun 7, 2004
    #8
  9. Good deal. Thanks for updating. Glad to help.

    Jim Cheshire, MCSE, MCSD [MSFT]
    ASP.NET
    Developer Support


    This post is provided "AS-IS" with no warranties and confers no rights.


    --------------------
    >Thread-Topic: How to judge whether it is under the design mode?
    >thread-index: AcRMsQT/HcjI5EhLQtmSBnK/8HMRxw==
    >X-WN-Post: microsoft.public.dotnet.framework.aspnet.webcontrols
    >From: "=?Utf-8?B?TGFzZXIgTHU=?=" <>
    >References: <>

    <>
    <>
    <>
    <>
    <>
    >Subject: RE: How to judge whether it is under the design mode?
    >Date: Mon, 7 Jun 2004 10:01:04 -0700
    >Lines: 41
    >Message-ID: <>
    >MIME-Version: 1.0
    >Content-Type: text/plain;
    > charset="Utf-8"
    >Content-Transfer-Encoding: 7bit
    >X-Newsreader: Microsoft CDO for Windows 2000
    >Content-Class: urn:content-classes:message
    >Importance: normal
    >Priority: normal
    >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    >Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
    >Path: cpmsftngxa10.phx.gbl
    >Xref: cpmsftngxa10.phx.gbl

    microsoft.public.dotnet.framework.aspnet.webcontrols:21209
    >NNTP-Posting-Host: tk2msftcmty1.phx.gbl 10.40.1.180
    >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
    >
    >

    Hi, Jim! Thank you very much!! It really works!
    ----- Jim Cheshire [MSFT] wrote: -----

    Hi,

    Yes, it is possible via extensibility. DTE.ActiveDocument.FullName
    will
    return the path to the document currently being edited.

    Jim Cheshire, MCSE, MCSD [MSFT]
    ASP.NET
    Developer Support


    This post is provided "AS-IS" with no warranties and confers no rights.

    --------------------
    >Thread-Topic: How to judge whether it is under the design mode?
    >thread-index: AcRLpX3M2N4CeykVQk6vSMjOWxuWXA==
    >X-WN-Post: microsoft.public.dotnet.framework.aspnet.webcontrols
    >From: "=?Utf-8?B?TGFzZXIgTHU=?="

    <>>References:
    <><9857E26A-6E51-4529-8F7A
    ><3DFFF806-3F6E-4FC4-90D9-C54457BC9AF4@microsoft.
    com><>>Subject: RE: How to judge
    whether it is under the design mode?
    >Date: Sun, 6 Jun 2004 02:06:02 -0700
    >Lines: 1
    >Message-ID:

    <>>MIME-Version: 1.0
    >Content-Type: text/plain;
    > charset="Utf-8"
    >Content-Transfer-Encoding: 7bit
    >X-Newsreader: Microsoft CDO for Windows 2000
    >Content-Class: urn:content-classes:message
    >Importance: normal
    >Priority: normal
    >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    >Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
    >Path: cpmsftngxa10.phx.gbl
    >Xref: cpmsftngxa10.phx.gbl

    microsoft.public.dotnet.framework.aspnet.webcontrols:21193
    >NNTP-Posting-Host: tk2msftcmty1.phx.gbl 10.40.1.180
    >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
    >>For example, I want to get the file path of the currently editing

    aspx
    page in code. Is that possible?
    >
    >
     
    Jim Cheshire [MSFT], Jun 8, 2004
    #9
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Michael Wilcox

    Judge Judy hears a web design case

    Michael Wilcox, Dec 24, 2003, in forum: HTML
    Replies:
    20
    Views:
    891
    Matthew Superstar Swass
    Dec 31, 2003
  2. John J Lee
    Replies:
    3
    Views:
    551
    bruno at modulix
    Dec 1, 2005
  3. momobear
    Replies:
    26
    Views:
    559
    Antoon Pardon
    Mar 26, 2007
  4. Edward Loper
    Replies:
    0
    Views:
    527
    Edward Loper
    Aug 7, 2007
  5. Replies:
    2
    Views:
    157
    Sevinfooter
    Jul 20, 2006
Loading...

Share This Page