I\'m trying to implement the WMD editor used on StackOverflow to create some basic Wiki-style functionality. I\'m up to the point where it\'s time to save to the database, but
Absolutely save the Markdown code as entered by the user.
Then you'll need a Markdown converter that will convert it to HTML for displaying it.
You'll find a bunch of these at
http://en.wikipedia.org/wiki/Markdown#Converters
and
http://markdown.infogami.com/
I'd vote against using JS in your case. There appears to be a .NET implementation but I can't tell you how good it is.
While rendering your page you'll have to pass the Markdown code to a converter like the above and then output the returned HTML.
If performance is an issue you might also consider saving both the Markdown code (for later editing) AND the HTML code (for displaying) inthe database. That way it will only be converted once.