Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Best way to store article content in ASP.NET MVC application

Posted on 2010-09-24
3
Medium Priority
?
429 Views
Last Modified: 2013-11-08
What is the best way to persist content of articles in ASP.NET MVC application? For example, I may have some model class named Article. This class may have a property named Content that stores the full content of the article, so i t can be persisted in the DB. The problem is that usually articles consist of several paragraphs that in turn may have some formatting, so I need to place some HTML markup in the content. Following the separation of concerns principle it is not a good thing to do. Is it OK to keep some markup with the content in the DB or is there a bettter way to keep the content with formatting?
0
Comment
Question by:yamir2k
  • 2
3 Comments
 
LVL 52

Accepted Solution

by:
Carl Tawn earned 2000 total points
ID: 33753421
If the markup is part of the content of the article then it's not a "separation of concern" issue. If you were storing markup that did stuff to the markup that wasn't part of the article then that would be a different issue.
0
 
LVL 1

Author Comment

by:yamir2k
ID: 33753841
As I understand, any markup that can't be removed from the content without losing its structure is a part of content. So, basic markup like <p> tags, etc. should be persisted with the text of the article, right?
0
 
LVL 52

Expert Comment

by:Carl Tawn
ID: 33753992
Correct. If it's markup that purely controls formatting of the article itself then it is part of the content, and therefore should be stored with the content.
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
While opting for any web-to-print solution, you need to discuss with your team and some of your end users and know their opinions about your decisions. In this article we list down some questions you need to ask yourself.
Wufoo.com provides powerful tools for surveying targeted groups, and utilizing data from completed surveys to find trends, discover areas of demand or customer expectation, and make business decisions on products or services.
Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.

877 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question