Solved

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

Posted on 2010-09-24
3
370 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 500 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

If I have to fix slow responding website my first thoughts are server side optimizations: the database may not be optimized or caching is not enabled, or things like that. We often overlook another major part of our web application: the client. We o…
Introduction A frequently used term in Object-Oriented design is "SOLID" which is a mnemonic acronym that covers five principles of OO design.  These principles do not stand alone; there is interplay among them.  And they are not laws, merely princ…
This video teaches viewers how to create their own website using cPanel and Wordpress. Tutorial walks users through how to set up their own domain name from tools like Domain Registrar, Hosting Account, and Wordpress. More specifically, the order in…
This video teaches users how to migrate an existing Wordpress website to a new domain.

773 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