简体   繁体   中英

How to store web page content in sql server

In general at a fairly high level, and without building an entire CMS, what do I need to know about storing web page content (eg say several hundred articles and text up to approx. 2500 words in length) and photos in sql server in a templated web page design?

Do I store the actual content in the db or store in the files on the server and just put links in the db?

What would some asp.net code look like to display it out of the db and flow it into a css-based layout?

Storing content in a db is very much an accepted way of doing things. The simplest examples I can think of for your question are to have a look at the source code of the smaller blog packages.

They have very bare bone implmentations for displaying db content in xhtml layouts.

The complexity is completely up to you, at the lowest level you could fetch a text field out of the db with ado.net and set a Literal control in your aspx page.

Or...again, on the out-of-the-box cms front:

It is possible to store the web page content in the database and many CMSs do just this. There are many many ways of achieving this.

"...without building an entire CMS" sounds like famous last words to me though. I suggest you look into third party CMSs.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM