Solved

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

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

Network it in WD Red

There's an industry-leading WD Red drive for every compatible NAS system to help fulfill your data storage needs. With drives up to 8TB, WD Red offers a wide array of solutions for customers looking to build the biggest, best-performing NAS storage solution.  

Question has a verified solution.

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

Developer tools in browsers have been around for a while, yet they are still heavily underused by developers. Developers still fix html or CSS then refresh page to see effect, or they put alert or debugger in JavaScript and then try again and again …
There is a huge demand for CodeIgniter among the PHP web developers due to its dynamic features and benefits these days. It is one of most popular and agile open source PHP framework for creating robust web applications in PHP web development field.…
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…
Learn how to set-up PayPal payment integration in your Wufoo form. Allow your users to remit payment through PayPal upon completion of your online form. This is helpful for collecting membership payments, customer payments, donations, and more.

895 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now