Tuesday 1 July 2014

Simple CMS System in Asp.Net

Today, i will show the way to create simple CMS system in asp.net websites.This can be used to generate dynamic content pages or simple blog application in dot net.Though content on page is dynamic but yo must add a aspx page manually in your application. You may tweak this application according to your need to add dynamic pages on the fly in asp.net web applications or websites.

cms in asp.net

Steps to create cms system in asp.net:
1. First create a database in sql server and compile the following script for one of the tables to store dynamic content:
USE [CMS]
GO
/****** Object:  Table [dbo].[cms_page]    Script Date: 06/30/2014 09:57:36 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[cms_page](
    [page] [nvarchar](50) NULL,
    [html] [ntext] NULL,
    [id] [int] IDENTITY(1,1) NOT NULL,
 CONSTRAINT [PK_cms_page] PRIMARY KEY CLUSTERED 
(
    [id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

2. Now add a page to manage dynamic content pages.
3. Now add a label and literal control on any page to show dynamic content. Bind data to label and literal using sql query.
4.I am using CKEDITOR as html content editor.
5. Download full attachment here.







No comments:

Post a Comment

Blogger