Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8699505
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T01:57:54+00:00 2026-06-13T01:57:54+00:00

So I am handling my own custom Route mapping (rather than allowing ServiceStack to

  • 0

So I am handling my own custom Route mapping (rather than allowing ServiceStack to automatically handle it), simply because all of my data is stored inside of a database, page content and all. I have a series of _Layout.cshtml files, and my Markdown is stored as a string.

So I suppose I am asking, what type of Service do I need to inherit (regular Service?) for my mapped Route, and what do I need to return to state “use Layout X and Markdown in string Y” ?

I have read through the examples on the ServiceStack Wiki and new example page, and was unable to find any samples for achieving this (everything seemed to be reading Markdown from a file, and Razor reading variables from a Database).

Please let me know if I am not clear in my question, and I will be happy to modify it accordingly.

—

EDIT

Some clarification:

Yes I got the regular Razor pages to load.
Yes I got the regular Markdown from files to load.

I am simply now curious how to render Markdown into the Razor method “RenderBody()” which is in a string (from my database).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T01:57:55+00:00Added an answer on June 13, 2026 at 1:57 am

    If you simply want to render a Markdown text as HTML (not Markdown Razor, ie no razor functionality!) you need to do these two steps:

    var renderer = new MarkdownSharp.Markdown();
    string html = renderer.Transform("___your_markdown_markup_here___");
    

    Now you only have to add the rendered HTML to your Razor view at the appropriate place for example.


    However, if your goal is to render a normal Markdown view (ie .md file in your ServiceStack project) in a Razor view, you need to follow this quote:

    Include Partial Markdown views in Razor pages

    We loved Markdown and Razor so much that included in ServiceStack is
    an enhanced version of Markdown with Razor functionality and Syntax
    called Markdown Razor which should be instantly familiar to existing
    Razor users.

    As we expect Razor + Markdown to be an increasingly popular
    combination we’ve extend @Html.Partial() support to also embed
    Partials from different View Engines. This feature lets you embed any
    Markdown Page as we’ve done in each of the content-heavy Rockstar
    pages using the standard Razor Partial syntax:

    @Html.Partial("Content")
    

    Which tells ServiceStack to embed a Partial named Content inside the page at that location. First it will look for a Partial named
    Content.cshtml followed by a Partial named Content.md if it reaches
    the Markdown Razor View Engine. Initially it searches the current
    directory, followed by any matching Partials in the /Views/Shared
    folder.

    Quoted from http://razor.servicestack.net.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i'm planning on making my own custom session handling functions. i want to save
I have a custom ListView with my own adapter. I'm handling the click on
I have two PL/SQL Stored procedure each handling its own Transaction (Begin/Commit and Rollback
when handling data, i always have to write the following: var dataSourceRequest:URLRequest = new
ExtJS Class Handling is good to handle, but you have to pay it with
How should I be handling, or rather NOT handling (ignoring), touches to my background
As per this article , I've extended the System.Windows.Forms.WebBrowser class to implement custom error-handling.
I'm creating my own HTML5 audio player capable of handling playlists. I have created
I have a fair amount of experience with the DataContractSerializer and handling custom type
I'm trying to work out the best way of handling custom error pages within

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.