ViewPort in _Layout (RAZOR)

  1. #1

    ViewPort in _Layout (RAZOR)

    Hi,

    I have in my _Layout.cshtml a viewPort like this:

    @(X.Viewport()
            .StyleSpec("background-color: transparent;float:left")
            .Layout(LayoutType.Border)
            .Items(
                X.Panel()
                    .Title("North")
                    .Region(Region.North),
                X.Panel()
                    .Title("West")
                    .Region(Region.West)
                    .Layout(LayoutType.Accordion)
                    .Split(true)
                    .Collapsible(true),
                X.Panel()
                    .Title("Center")
                    .Region(Region.Center)
                    .Content(
                       @<div id="center" style="">
                           @RenderBody()
                       </div>
                       )
               )
    )
    How you can see, I call @RenderBody() inside CENTER PANEL, and my west panel is collapsible. I have an index.cshtml and his layout is that _Layout.cshtml and inside the index there is a GRID

    I have two problems with my index.cshtml:

    1. If my navigator window is of 1000px (for example), the grid width is 1000px instead of 800px (becase left panel is 200px). I want that my panel width was 800px and

    2. When i callpse the left panel, my grid of the index is moved to the left side (that is correct), the problem is that the right side of the grid is empty... in other word, my grid is not anchored to the right side of the navigator.


    I am trying to trial many ways to achieve that effect but without good results Can anyone give me any idea?

    thanks in advance.
  2. #2
    Hello @queriable!

    Have you tried searching for this topic on the forums beforehand? I've just found this that is probably what you want to accomplish:

    [RAZOR] Using viewport to make panel fit available browser window.

    I hope this helps!
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. Please Give your Opinion about one _Layout
    By kdms in forum 3.x Help
    Replies: 1
    Last Post: Feb 20, 2015, 12:18 PM
  2. [CLOSED] Help refreshing Viewport - Razor MVC ext 2.5
    By LAEUser in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Oct 07, 2014, 4:45 AM
  3. Conversion of site.master _layout.cshtml
    By gdog_5021 in forum 2.x Help
    Replies: 0
    Last Post: Jul 21, 2012, 4:21 AM
  4. Replies: 3
    Last Post: Jun 22, 2012, 4:18 PM
  5. [CLOSED] [Razor] Setup Auto load panel in razor
    By UnifyEducation in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Apr 27, 2012, 10:54 AM

Tags for this Thread

Posting Permissions