Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • dave 36 posts 149 karma points
    May 01, 2015 @ 14:33
    dave
    0

    Partial View within a content section?

    I have setup a new master page. I also have setup a partial view reference within the master page.

    I only want that partial view to show on the the home page.

    Going over the structure of master pages and content pages how do i reference on a content page? How would i put the following reference to a partial view within a content section on a single page?

    It works fine if i put directly within the master page. In my scenario this will be in a cell of the master page.

    thanks

    i.e. @Html.Partial("/App_Plugins/Articulate/Views/displaySingleTopBlogItemsonHomepage2.cshtml")

  • Urvish 252 posts 776 karma points
    May 01, 2015 @ 15:08
    Urvish
    0

    Hi Dave,

    In the Master page you need to add @RenderBody().

    And than in the content page you need to set layout of the master page.

    @{
        Layout = "~/.../Master.cshtml";
    }
    

    Hope it helps.

    Regards,

    Urvish Mandaliya

  • Urvish 252 posts 776 karma points
    May 01, 2015 @ 15:10
    Urvish
    0

    You can also call partial view in content page.

    It this is not the case than if you can explain more , so we could have idea what is the issue.

    Regards,

    Urvish Mandaliya

  • dave 36 posts 149 karma points
    May 03, 2015 @ 21:17
    dave
    0

    What confused me is... a) you have master pages, then template pages then content pages (3 levels)

    The master page has base html structure and references to css, the template page references the master page and has additional html structure. On top of both those levels you have a page/content page.

    It doesn't appear that you have direct access to the html within the content page (like you do for master and template pages)

    It sort of appears like admin's are to have rights to master and template pages and then you would give editors the ability to manage the content pages (adding html through gui).

    Is this the right thinking?

  • Urvish 252 posts 776 karma points
    May 04, 2015 @ 07:26
    Urvish
    0

    Hi Dave,

    Its right you can give rights to the Editors to manage content pages.

    And ultimately you content page would display as a page.

    So whatever your site structure is , you can use partial view to display content.

    Regards,

    Urvish Mandaliya

Please Sign in or register to post replies

Write your reply to:

Draft