How do I maintain formatting of comments when I save them to the database in an asp.net mvc applicat

Posted by baijajusav on Stack Overflow See other posts from Stack Overflow or by baijajusav
Published on 2010-03-16T16:02:40Z Indexed on 2010/03/16 16:11 UTC
Read the original article Hit count: 341

Filed under:
|
|

The title was probably not very clear. Consider this scnerio: you have a blog site or really just any site where a user can respond via a comment. You want to maintain the formatting for the comments. So paragraph's should be separated, first sentence indented, bolding of keywords allowed, etc. How would one go about doing this?

This is something just about every kind of blogging site handles, including this site. My initial guess is that comments are saved to that database either in an xml format or as the raw html. Those are really my only guesses. I suppose magic strings could be used to denote the starting and ending of various formatting as well, but magic strings are generally frowned upon.

I'm doing this in an asp.net mvc application. I'm using version 1 of mvc, but I would be willing to move to 2 if that makes for an easy solution here.

© Stack Overflow or respective owner

Related posts about asp.net-mvc

Related posts about ASP.NET