Copied to clipboard

Flag this post as spam?

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


  • Amigo 245 posts 600 karma points
    May 12, 2015 @ 06:02
    Amigo
    0

    Render partial view inside MacroEngines razor file

    Is there some way to render a partial view inside a MacroEngines scripting razor file?

  • Alex Skrypnyk 6182 posts 24284 karma points MVP 8x admin c-trib
    May 12, 2015 @ 13:09
    Alex Skrypnyk
    0

    Hi Amigo,

    Did you try like that :

    @Html.Partial("nameOfPartial", Model)
    
    @Html.Partial("nameOfPartial")
    

    Thanks

  • Amigo 245 posts 600 karma points
    May 12, 2015 @ 20:20
    Amigo
    0

    Hi Alex,

      @Html.Partial("nameOfPartial") works fine when i try in my template.

    But i simply cant get it to work inside my cshtml macro script.

    What do i need to inheret/using to do it? 

     

  • Amigo 245 posts 600 karma points
    May 12, 2015 @ 20:29
    Amigo
    0

    tryed this too but no luck:
      @System.Web.Mvc.Html.PartialExtensions.Partial(Model, "nameOfPartial") 

  • Amigo 245 posts 600 karma points
    May 13, 2015 @ 01:33
    Amigo
    100

    Hi again,

    I have solved this by writing a Partial View Macro file instead.
    Still could not use  "@Html.Partial("nameOfPartial")" inside that one (no idea why), but i just render output direct instead.

    Thanks ;-)

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies