Copied to clipboard

Flag this post as spam?

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


  • Paul Stewart 50 posts 71 karma points
    Mar 12, 2012 @ 10:44
    Paul Stewart
    0

    Razor changing value in text string

    Hey guys Im having trouble with razor. Basically with youtube. The client does want to enter a youtube video through the rich text editor, but would rather prefer something that a dynamic tool (which in this case I am using Embedded Content by TheFarm) 

    I have the cshtml working, rendering out all the elements but I need to replace the "/watch?v=" with "/embed/" to make the video show on the web page. 

    Does any one know how to change the value of a text string with in razor? 

    Regards Paul

  • Paul Stewart 50 posts 71 karma points
    Mar 12, 2012 @ 11:02
    Paul Stewart
    0

    Got it working...

    string youtubeUrl = Model.youtubeURl;
    youtubeUrl = youtubeUrl.Replace("/watch?v=", "/embed/");
Please Sign in or register to post replies

Write your reply to:

Draft