Copied to clipboard

Flag this post as spam?

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


  • JoskerVemeulen 68 posts 262 karma points
    Mar 18, 2019 @ 16:48
    JoskerVemeulen
    0

    uChangeContentType in v8

    To build my robots.txt I need to change the content type. In v7 this was done bij umbraco.library.ChangeContentType("text/plain"); But how to go about it in v8?

    Thanks!

  • Søren Gregersen 441 posts 1884 karma points MVP 2x c-trib
    Mar 18, 2019 @ 18:06
    Søren Gregersen
    0

    are you talking about setting the mimetype of the response?

    https://stackoverflow.com/questions/7509266/setting-mime-type-in-asp-net

  • Stuart Nisbett 13 posts 59 karma points
    Oct 21, 2019 @ 15:03
    Stuart Nisbett
    3

    Try: Response.ContentType = "text/plain";

  • Heather Floyd 610 posts 1033 karma points MVP 6x c-trib
    Apr 02, 2024 @ 17:56
    Heather Floyd
    0

    And in Umbraco 9+:

    Context.Response.ContentType ="text/plain";
    
  • 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