Solved

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

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Foreword (May 2015) This web page has appeared at Google.  It's definitely worth considering! https://www.google.com/about/careers/students/guide-to-technical-development.html How to Know You are Making a Difference at EE In August, 2013, one …
In this article you'll learn how to use Ajax calls within your CodeIgniter application. To explain this, I'll illustrate how to implement a simple contact form to allow visitors to send you an email through your web site.
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
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.

708 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

18 Experts available now in Live!

Get 1:1 Help Now