ASP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingASP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old September 23rd, 2002, 01:46 PM
lynnit lynnit is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2002
Posts: 7 lynnit User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Creating Page Breaks

Here's my question! I'm wanting to display articles on my site dynamically using ASP/Access. (Actually I'm using Dreamweaver MX).

I would like to be able to split the longer articles into different pages and then have a table of contents similiar to what DevArticles does.

Can anybody point me in the right direction so that I can do this? I have ideas on how to do this but there has to be easier ways.

Thanks

Reply With Quote
  #2  
Old September 23rd, 2002, 02:18 PM
CTretina CTretina is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Posts: 9 CTretina User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to CTretina Send a message via Yahoo to CTretina
Articles and Pages

To lynnit:

Currently, I am working on a content management system with similar capibilities and am developing with ASP.NET and Microsoft SQL Server. Using said RDMS, here are the three table build scripts which you might need:

IF EXISTS (
SELECT *
FROM dbo.SysObjects
WHERE ID = object_id(N'[dbo].[Articles]')
AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE [dbo].[Articles]
GO

CREATE TABLE [dbo].[Articles] (
[ArticleID] [int] IDENTITY (1, 1) NOT NULL,
[Description] [ntext] NOT NULL,
[Name] [nvarchar] (255) NOT NULL,
[Published] [bit] NOT NULL DEFAULT '1',
[Timestamp] [datetime] NOT NULL DEFAULT GETDATE(),
[UserID] [int] NOT NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

IF EXISTS (
SELECT *
FROM dbo.SysObjects
WHERE ID = object_id(N'[dbo].[Pages]')
AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE [dbo].[Pages]
GO

CREATE TABLE [dbo].[Pages] (
[PageID] [int] IDENTITY (1, 1) NOT NULL,
[Content] [ntext] NOT NULL,
[Name] [varchar] (255) NOT NULL,
[Number] [int] NOT NULL,
[Timestamp] [datetime] NOT NULL DEFAULT GETDATE(),
[ArticleID] [int] NOT NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

IF EXISTS (
SELECT *
FROM dbo.SysObjects
WHERE ID = object_id(N'[dbo].[Users]')
AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE [dbo].[Users]
GO

CREATE TABLE [dbo].[Users] (
[UserID] [int] IDENTITY (1, 1) NOT NULL,
[Email] [nvarchar] (255),
[Enabled] [bit] NOT NULL DEFAULT '1',
[FirstName] [nvarchar] (255),
[MiddleName] [nvarchar] (255),
[LastName] [nvarchar] (255),
[Password] [nvarchar] (255),
[Timestamp] [datetime] NOT NULL DEFAULT GETDATE(),
[UserName] [nvarchar] (255) NOT NULL
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[Articles] WITH NOCHECK ADD
CONSTRAINT [PK_Articles] PRIMARY KEY NONCLUSTERED
(
[ArticleID]
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[Pages] WITH NOCHECK ADD
CONSTRAINT [PK_Pages] PRIMARY KEY NONCLUSTERED
(
[PageID]
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[Users] WITH NOCHECK ADD
CONSTRAINT [PK_Users] PRIMARY KEY NONCLUSTERED
(
[UserID]
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[Articles] WITH NOCHECK ADD
CONSTRAINT [FK_Articles_Users] FOREIGN KEY
(
[UserID]
)
REFERENCES [dbo].[Users]
(
[UserID]
) ON DELETE CASCADE NOT FOR REPLICATION
GO

ALTER TABLE [dbo].[Pages] WITH NOCHECK ADD
CONSTRAINT [FK_Pages_Articles] FOREIGN KEY
(
[ArticleID]
)
REFERENCES [dbo].[Users]
(
[ArticleID]
) ON DELETE CASCADE NOT FOR REPLICATION
GO

From a UI perspective, I'd imagine that you'd want to create a front-end to the Users table where one could add, edit or delete users. Thereafter, you'll create an Articles front-end where users can add, edit or delete articles. Once an article is created, a link would be available next to that article labeled "Pages." Clicking on that link would take the user to another front-end where he/she could add, edit, delete or change the order of pages associated with that particular article.

When you go to display the documents to the end-user, then you would first execute the following SELECT statement to return all of the availabe articles:

SELECT Articles.Description, Articles.Name, Articles.Timestamp, Users.UserName
FROM Articles, Users
WHERE Articles.Published = 1

Then, when the user clicks on a specific article, you would execute the following SELECT statement to return that particular article's pages:

SELECT Articles.Name, Articles.Timestamp, Pages.Name, Pages.Number, Users.UserName
FROM Articles, Pages, Users
WHERE Articles.ArticleID = [Requested article's ID]

You could then create an ordered/unordered list of the pages from this data for your Table of Contents and force the user to click on the link for a particular page. Thereafter, you'd execute the following SQL statement to return the proper page's content:

SELECT Articles.Name, Articles.Timestamp, Pages.Content, Pages.Name, Pages.Number, Users.UserName
FROM Articles, Pages, Users
WHERE Articles.ArticleID = [Requested article's ID]
AND Pages.PageID = [Requested page's ID]

And then you'd display the HTML.

I hope this helps. If you have any questions, then please feel free to send them my way. Thanks and have a good one!

Reply With Quote
  #3  
Old September 23rd, 2002, 09:19 PM
lynnit lynnit is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2002
Posts: 7 lynnit User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thank You! That was very helpful

Reply With Quote
  #4  
Old September 23rd, 2002, 10:01 PM
CTretina CTretina is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Posts: 9 CTretina User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to CTretina Send a message via Yahoo to CTretina
No problem; anytime! Please feel free to contact me with any further questions. Have a good one.

Reply With Quote
  #5  
Old September 28th, 2002, 11:36 AM
aspnewbie aspnewbie is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: The Great White North
Posts: 361 aspnewbie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 58 m 50 sec
Reputation Power: 8
Send a message via MSN to aspnewbie
You might want to read this thread as well, where James sets out the underlying database structure.

http://www.devarticles.com/forum/sh...s=&threadid=860

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingASP Development > Creating Page Breaks


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

Request Your Free Technology Downloads!
 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

Request Your Free Technology Downloads!
 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

Request Your Free Technology Downloads!
 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

Request Your Free Technology Downloads!
 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

Request Your Free Technology Downloads!
 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 




© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 3 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek