Copied to clipboard

Flag this post as spam?

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


  • Anders 4 posts 74 karma points
    Nov 08, 2015 @ 20:07
    Anders
    0

    Adding css from MacroPartial

    How is it possible to add some css from macro partial?. I am working on site based on grid. From datatype grid pages will be creatde og macros containing html sections.

    Some of sections is contains css only for this section.

    I have tried setting up with: @RenderSection("css", required: false)

    Also I have tried to make an HtmlExtensions helper. This is working out just fine if I add inside But when adding inside css codes is not added.

    Can anyone show example on how this can be done? Thanks

  • Rune Hem Strand 147 posts 911 karma points hq c-trib
    Nov 11, 2015 @ 06:48
    Rune Hem Strand
    0

    Hey Anders

    Not sure what you are trying to achieve. Can you give an example?

  • Matthew Kirschner 323 posts 611 karma points
    Nov 12, 2015 @ 20:32
    Matthew Kirschner
    0

    Hi, Anders.

    If I understand you correctly, it seems like you want to add some css to a macro partial.

    To do this, add the following include and script to your view:

    @using ClientDependency.Core.Mvc
    
    @{
        Html.RequiresCss("~/css/FILE_NAME.css");
    }
    
  • Damian Chambers 23 posts 87 karma points
    Nov 24, 2015 @ 13:12
    Damian Chambers
    0

    Try using the "style" tag inside the macro partial file.

  • 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