Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2010-09-24
3
Medium Priority
?
418 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Simplify Your Workload with One Tool

How do you combat today’s intelligent hacker while managing multiple domains and platforms? By simplifying your workload with one tool. With Lunarpages hosting through Plesk Onyx, you can:

Automate SSL generation and installation with two clicks
Experience total server control

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 …
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
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.

705 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