Copied to clipboard

Flag this post as spam?

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


  • Kevin Duong 15 posts 85 karma points
    Feb 28, 2017 @ 18:57
    Kevin Duong
    0

    Adding DateTime.Now to rich text editor

    I have a rich text editor field and want to add the year to the line. I've tried using a macro, but I can't get the macro to be inline.

    So right now here's what I have in my view

    @Html.Raw(Model.Content.Replace("%YEAR%", DateTime.Now.Year.ToString()))
    

    and here's what I have in the editor: © 2003-%YEAR%

    This works, but I was wondering if there was a better way to do this.

  • 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