Determine PageLayout programatically

Discussion in 'ASP .Net Building Controls' started by Tim Pacl, Jul 8, 2003.

  1. Tim Pacl

    Tim Pacl Guest

    I am building a custom server control. I need to
    determine whether the page the custom control resides in
    is in flow layout or grid layout. Because I am doing this
    from the server control, I need to determine this
    programatically.

    Any help is appreciated.
    Tim Pacl, Jul 8, 2003
    #1
    1. Advertising

  2. Tim Pacl

    Marina Guest

    I dont' think this is possible. The layout mode of the page is really just
    for the designer. It determines whether the resulting html will have
    absolute positioning (i.e. specify the location of every element), or if it
    will just have the elements on the page, and they will be rendered as layed
    out.

    There is only a directive in the .aspx for design time support that let's
    VS.NET which mode you are in - it is irrelevant as far as the browser is
    concerned.

    "Tim Pacl" <> wrote in message
    news:109301c34571$ce08a580$...
    > I am building a custom server control. I need to
    > determine whether the page the custom control resides in
    > is in flow layout or grid layout. Because I am doing this
    > from the server control, I need to determine this
    > programatically.
    >
    > Any help is appreciated.
    Marina, Jul 8, 2003
    #2
    1. Advertising

  3. Hello Tim,

    I will look into it to see if it is possible to do so and reply you here.
    Thanks.

    Best regards,
    yhhuang
    VS.NET, Visual C++
    Microsoft

    This posting is provided "AS IS" with no warranties, and confers no rights.
    Got .Net? http://www.gotdotnet.com
    --------------------
    !Content-Class: urn:content-classes:message
    !From: "Tim Pacl" <>
    !Sender: "Tim Pacl" <>
    !References: <109301c34571$ce08a580$>
    <>
    !Subject: Re: Determine PageLayout programatically
    !Date: Tue, 8 Jul 2003 10:17:41 -0700
    !Lines: 49
    !Message-ID: <026001c34574$d6d3e640$>
    !MIME-Version: 1.0
    !Content-Type: text/plain;
    ! charset="iso-8859-1"
    !Content-Transfer-Encoding: 7bit
    !X-Newsreader: Microsoft CDO for Windows 2000
    !Thread-Index: AcNFdNbTwiN6mzSjTNiYrB6m7XSRjw==
    !X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
    !Newsgroups: microsoft.public.dotnet.framework.aspnet.buildingcontrols
    !Path: cpmsftngxa09.phx.gbl
    !Xref: cpmsftngxa09.phx.gbl
    microsoft.public.dotnet.framework.aspnet.buildingcontrols:1639
    !NNTP-Posting-Host: TK2MSFTNGXA11 10.40.1.163
    !X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.buildingcontrols
    !
    !Understood. pagelayout sets the ms_positioning atrribute
    !of the body tag. It sets the page to flow or absolute
    !positioning. I am trying to determine what the
    !ms_positioning attribute is set to.
    !
    !My control inherits from a Table. in gridlayout I can set
    !the position of this control as follows:
    !Container.Style["POSITION"] = this.Style["POSITION"];
    !Container.Style["TOP"] = this.Style["TOP"];
    !Container.Style["LEFT"] = this.Style["LEFT"];
    !Container.Style["Z-INDEX"] = this.Style["Z-INDEX"];
    !
    !However in Flow layout this causes an error.
    !
    !I guess I will just use the generated error to determine
    !the ms_positioning. If the above generates an error, I am
    !in flowlayout.
    !>-----Original Message-----
    !>I dont' think this is possible. The layout mode of the
    !page is really just
    !>for the designer. It determines whether the resulting
    !html will have
    !>absolute positioning (i.e. specify the location of every
    !element), or if it
    !>will just have the elements on the page, and they will
    !be rendered as layed
    !>out.
    !>
    !>There is only a directive in the .aspx for design time
    !support that let's
    !>VS.NET which mode you are in - it is irrelevant as far
    !as the browser is
    !>concerned.
    !>
    !>"Tim Pacl" <> wrote in message
    !>news:109301c34571$ce08a580$...
    !>> I am building a custom server control. I need to
    !>> determine whether the page the custom control resides
    !in
    !>> is in flow layout or grid layout. Because I am doing
    !this
    !>> from the server control, I need to determine this
    !>> programatically.
    !>>
    !>> Any help is appreciated.
    !>
    !>
    !>.
    !>
    !
    Yan-Hong Huang[MSFT], Jul 10, 2003
    #3
  4. Hello,

    The link is:
    http://msdn.microsoft.com/library/en-us/vsintro7/html/vxlrfDocumentsPropertyDTEObject.asp?frame=true

    http://msdn.microsoft.com/library/en-us/vsintro7/html/vxlrfDTEObject.asp?frame=true

    HTH.

    Best regards,
    yhhuang
    VS.NET, Visual C++
    Microsoft

    This posting is provided "AS IS" with no warranties, and confers no rights.
    Got .Net? http://www.gotdotnet.com
    --------------------
    !X-Tomcat-ID: 253629259
    !References: <109301c34571$ce08a580$> <>
    <026001c34574$d6d3e640$>
    !MIME-Version: 1.0
    !Content-Type: text/plain
    !Content-Transfer-Encoding: 7bit
    !From: (Yan-Hong Huang[MSFT])
    !Organization: Microsoft
    !Date: Fri, 11 Jul 2003 10:08:59 GMT
    !Subject: Re: Determine PageLayout programatically
    !X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.buildingcontrols
    !Message-ID: <>
    !Newsgroups: microsoft.public.dotnet.framework.aspnet.buildingcontrols
    !Lines: 93
    !Path: cpmsftngxa06.phx.gbl
    !Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet.buildingcontrols:6539
    !NNTP-Posting-Host: TOMCATIMPORT1 10.201.218.122
    !
    !Hi Tim,
    !
    !The PageLayout is not a property of the Page object but is actually a property of the document object. Document Object is
    !not a server side object and you can see that the Layout is persisted in the BODY tag in the ASPX page in the HTML
    !Designer. (e.g. <body MS_POSITIONING="GridLayout">)
    !
    !If you would like to determine this during the design time, then as far as I know, there is no straightforward way of accessing
    !the document object from ASP.NET. You may have to use the Visual Studio automation object model (EnvDTE
    !namespace) to access the properties of the document. For more info checkout: ms-
    !help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.1033/vsintro7/html/vxlrfDocumentProperty.htm
    !Or
    !ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.1033/vsintro7/html/vxlrfdteobject.htm
    !
    !I haven't tried it myself but looks like this may be possibility. Thanks.
    !
    !Best regards,
    !yhhuang
    !VS.NET, Visual C++
    !Microsoft
    !
    !This posting is provided "AS IS" with no warranties, and confers no rights.
    !Got .Net? http://www.gotdotnet.com
    !--------------------
    !!Content-Class: urn:content-classes:message
    !!From: "Tim Pacl" <>
    !!Sender: "Tim Pacl" <>
    !!References: <109301c34571$ce08a580$> <>
    !!Subject: Re: Determine PageLayout programatically
    !!Date: Tue, 8 Jul 2003 10:17:41 -0700
    !!Lines: 49
    !!Message-ID: <026001c34574$d6d3e640$>
    !!MIME-Version: 1.0
    !!Content-Type: text/plain;
    !! charset="iso-8859-1"
    !!Content-Transfer-Encoding: 7bit
    !!X-Newsreader: Microsoft CDO for Windows 2000
    !!Thread-Index: AcNFdNbTwiN6mzSjTNiYrB6m7XSRjw==
    !!X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
    !!Newsgroups: microsoft.public.dotnet.framework.aspnet.buildingcontrols
    !!Path: cpmsftngxa09.phx.gbl
    !!Xref: cpmsftngxa09.phx.gbl microsoft.public.dotnet.framework.aspnet.buildingcontrols:1639
    !!NNTP-Posting-Host: TK2MSFTNGXA11 10.40.1.163
    !!X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.buildingcontrols
    !!
    !!Understood. pagelayout sets the ms_positioning atrribute
    !!of the body tag. It sets the page to flow or absolute
    !!positioning. I am trying to determine what the
    !!ms_positioning attribute is set to.
    !!
    !!My control inherits from a Table. in gridlayout I can set
    !!the position of this control as follows:
    !!Container.Style["POSITION"] = this.Style["POSITION"];
    !!Container.Style["TOP"] = this.Style["TOP"];
    !!Container.Style["LEFT"] = this.Style["LEFT"];
    !!Container.Style["Z-INDEX"] = this.Style["Z-INDEX"];
    !!
    !!However in Flow layout this causes an error.
    !!
    !!I guess I will just use the generated error to determine
    !!the ms_positioning. If the above generates an error, I am
    !!in flowlayout.
    !!>-----Original Message-----
    !!>I dont' think this is possible. The layout mode of the
    !!page is really just
    !!>for the designer. It determines whether the resulting
    !!html will have
    !!>absolute positioning (i.e. specify the location of every
    !!element), or if it
    !!>will just have the elements on the page, and they will
    !!be rendered as layed
    !!>out.
    !!>
    !!>There is only a directive in the .aspx for design time
    !!support that let's
    !!>VS.NET which mode you are in - it is irrelevant as far
    !!as the browser is
    !!>concerned.
    !!>
    !!>"Tim Pacl" <> wrote in message
    !!>news:109301c34571$ce08a580$...
    !!>> I am building a custom server control. I need to
    !!>> determine whether the page the custom control resides
    !!in
    !!>> is in flow layout or grid layout. Because I am doing
    !!this
    !!>> from the server control, I need to determine this
    !!>> programatically.
    !!>>
    !!>> Any help is appreciated.
    !!>
    !!>
    !!>.
    !!>
    !!
    !
    !
    !
    Yan-Hong Huang[MSFT], Jul 14, 2003
    #4
    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. Tim Pacl

    Determine PageLayout programatically

    Tim Pacl, Jul 8, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    317
    Marina
    Jul 8, 2003
  2. Brad
    Replies:
    5
    Views:
    401
    mikeb
    Jan 7, 2004
  3. Tina

    2005 - no PageLayout Property??

    Tina, Dec 17, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    1,322
    Andrew Robinson
    Dec 17, 2005
  4. Joseph Bittman MVP MCSD

    PageLayout

    Joseph Bittman MVP MCSD, Dec 19, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    437
    Joseph Bittman MVP MCSD
    Dec 19, 2005
  5. Tim Pacl

    Determine PageLayout programatically

    Tim Pacl, Jul 8, 2003, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    101
    Yan-Hong Huang[MSFT]
    Jul 11, 2003
Loading...

Share This Page