| |   Skin:   
      User: Not logged in 
Newsletter Signup
XSLT Library
Latest XML Blogs
Featured Examples
Featured Articles
Book Chapters
Training Courses
Sign In
My Profile
My Articles
My Examples
My Favorites
My Resources
Add a Resource
About Me
My Blog
HeadGeek Articles
Talking Portfolio
World Trip Pics

Forums Application examples
Author: Malinda Ng
Published: 11/28/2006 9:52 PM
Category: ADO.NET, ASP.NET, Caching, Localization, Validation Controls, VB.NET, VS.NET, Authentication, Database, SQL
Summary: Check it out:



1. This code does not presume to be the best way to write forums. In fact it

has some crazy things in it that could be done better. It's the result of somewhat

random hacking,  while I learned some interesting things from ASP.NET 2.0 Website Programming Problems-Design - Solution

The database tables have cascading delete relations in them, thus if you drop (delete)

a topic (forum), you will also drop all its threads and messages. If you drop a thread,

all the messages will go too.

 There is a threaded hierarchy in the messages table (parentmsgid) which allows you

to build a threaded view (for example using the tree control). It's not used in this code,

but it's there. That's why there's a Threads table too. If you delete the only message in a

thread without using the DeleteMessage stored procedure, you will leave an orphaned thread

in the threads table.

Sections are actually also forums. They can have threads inside them that only admins

can reach (via the jump column in the forum management page). One use of this might be to

allow moderators to have a private forum pertaining to a whole section. You could of course also

use an invisible forum for this purpose. The invisible forum is mainly there so you can create a

forum and get it all set up with FAQs and whatnot before you make it visible to users.

 I suggest you start with increments of 10,20,30 and so on so you can easily insert

new forums or sections between existing ones.

Try Atlas - wrapping the threads gridview inside an update panel works a treat 

Are there bugs? Almost certainly. But it works pretty well. If you find anything awful,

let me know at :)

 If you find the code is useful to you, please drop me a line  at


Fans of "The Office"
Dwight Bobbleheads are here!
  “It's me! I'm the bobblehead! Yes!”

Advertise on XMLPitstop

Advertise on XMLPitstop

EggHead Cafe
Web Servicee development
Buy text ads here!
remote online storage
Color Laser Printer
Bvlgari sunglasses
Skype vs. sipcall
VoIP Internettelefonie
Buy text ads here!

Interested in Text ads?
2,222 Total Members
35 members(last 30 days)
7 members(last 7 days)
1 members(today)

1,609 Total Discussions
12 Posts(last 30 days)
0 Posts(last 7 days)
0 Posts(today)

17,169 Total Blog Posts
1,748 Blogs(last 30 days)
251 Blogs(last 7 days)
0 Blogs(today)

8,699 Newsgroup Posts
0 Posts(last 30 days)
0 Posts(last 7 days)
0 Posts(today)

13,786 Total Resources
5 Resources(last 30 days)
1 Resources(last 7 days)
0 Resources(today)


David Silverlight's| 2801 Florida Ave #225|Miami, FL 33133|Ph:305-447-1139