10: Building a Web Forum in Visual Studio .NET
10: Building a Web Forum Encode Barcode In .NET Framework Using Barcode creation for ASP.NET Control to generate, create bar code image in ASP.NET applications. The User Interface for the Forum Application
Code 3 Of 9 Creation In C#.NET Using Barcode generator for VS .NET Control to generate, create ANSI/AIM Code 39 image in .NET framework applications. The Forum application uses the five pages shown in Figure 10-1 These pages are described in detail in the following sections Code39 Drawer In VS .NET Using Barcode printer for .NET Control to generate, create Code39 image in .NET applications. The Forum Home page
Encoding Code 3 Of 9 In Visual Basic .NET Using Barcode maker for .NET Control to generate, create Code-39 image in VS .NET applications. The home page for the Forum application, Defaultaspx, is shown in Figure 10-2 As you can see, this page lists the forums and topics that are available at the forum site In this case, there are two forums and a total of five topics To view the threads in one of the topics, the user clicks the link for the topic In case you re wondering how the forums and topics are displayed, nested Repeater controls do the trick The outer Repeater control displays the forums; then, for each forum, the inner Repeater control displays the available topics (More about how to pull off this bit of programming trickery later in this chapter) Barcode Generation In VS .NET Using Barcode creation for ASP.NET Control to generate, create bar code image in ASP.NET applications. Defaultaspx Forum Home page Threadsapx Threads page
Bar Code Drawer In VS .NET Using Barcode generation for ASP.NET Control to generate, create bar code image in ASP.NET applications. Messagesaspx Messages page NewThreadaspx Start New Thread page Figure 10-1: The page flow for the Forum application Painting Code 128 Code Set C In Visual Basic .NET Using Barcode generation for .NET Control to generate, create Code128 image in .NET framework applications. NewMessageasp Post Reply page
GTIN - 128 Generation In .NET Using Barcode drawer for Visual Studio .NET Control to generate, create GS1 128 image in VS .NET applications. Part V: Building Community Applications
EAN128 Drawer In C# Using Barcode generator for .NET Control to generate, create EAN 128 image in Visual Studio .NET applications. Figure 10-2: The Forum Home page
Print Data Matrix 2d Barcode In .NET Framework Using Barcode generation for Visual Studio .NET Control to generate, create Data Matrix image in .NET applications. The Threads page
Creating Bar Code In Visual C# Using Barcode maker for .NET Control to generate, create barcode image in VS .NET applications. The Threads page, shown in Figure 10-3, displays the threads in a given topic For each thread, the page lists the thread s subject, the e-mail address of the person who initiated the thread, the number of replies to the thread, and the date the thread was last replied to A GridView control is used to display this list Note that the thread subjects are links If the user clicks one of these links, the Forum application displays the messages for that thread, as described in the next section Notice also that beneath the list of threads are two links The first takes the user to the New Thread page to create a new thread The second link takes the user back to the forum s Home page Code 39 Extended Generator In Visual C# Using Barcode drawer for VS .NET Control to generate, create USS Code 39 image in .NET framework applications. The Messages page
Painting UPC Code In Java Using Barcode maker for Java Control to generate, create UPC-A Supplement 2 image in Java applications. When the user clicks one of the threads in the Threads page, the messages for that thread are displayed, as shown in Figure 10-4 This page displays the topic name and the thread subject, followed by the thread s original message and any replies Note that each message is preceded by a header that identifies who posted the message and when Generating GTIN - 13 In C# Using Barcode encoder for .NET framework Control to generate, create EAN-13 Supplement 5 image in VS .NET applications. 10: Building a Web Forum
EAN-13 Supplement 5 Maker In Java Using Barcode printer for Java Control to generate, create EAN13 image in Java applications. Figure 10-3: The Threads page
Generate Barcode In Java Using Barcode encoder for Java Control to generate, create bar code image in Java applications. Figure 10-4: The Messages page
Paint GTIN - 128 In Java Using Barcode creation for Java Control to generate, create EAN128 image in Java applications. Part V: Building Community Applications
Barcode Drawer In Java Using Barcode encoder for Java Control to generate, create bar code image in Java applications. The New Thread page
Decoding UPC - 13 In .NET Framework Using Barcode reader for VS .NET Control to read, scan read, scan image in .NET applications. If the user clicks the Start a New Thread link from the Threads page, the New Thread page is displayed, as shown in Figure 10-5 This page simply lets the user enter his or her e-mail address, a subject line, and the text for the thread s initial message Then, when the user clicks the Post Message button, the new thread is written to the Forum application s database Decoding Code 39 In .NET Framework Using Barcode decoder for .NET framework Control to read, scan read, scan image in .NET framework applications. Figure 10-5: The New Thread page
The Post Reply page
Figure 10-6 shows the Post Reply page, where you can add a message to an existing thread To post a reply, you must enter your e-mail address and the text of your reply, then click the Post Reply button This updates the database, then returns the user to the Messages page 10: Building a Web Forum
Figure 10-6: The Post Reply page
Designing the Database
The database for the Forum application requires the following four tables: Forums Topics Threads Messages Figure 10-7 presents a diagram that shows how these tables are related, and the following sections describe each table individually The Forums table
The Forums table stores information about each forum supported by the Web site Table 10-1 lists the columns defined for this table Part V: Building Community Applications
Forums forumid name description
Figure 10-7: A diagram of the Forum database
Topics topicid formid name description
Threads threadid topicid subject replies author lastpostdate
Messages msgid threadid author date message
Table 10-1 Column name
forumid
The Forums Table
Type
INT IDENTITY
Description
An identity column that provides a unique ID number for each forum supported by the site This is the primary key for the Forums table The forum s name A short description of the forum name description
VARCHAR(255) VARCHAR(255) The Topics table
The Topics table stores information for each of the topic areas available to users Table 10-2 lists the columns defined for this table Table 10-2 Column name
topicid
The Topics Table
Type
INT IDENTITY
Description
An identity column that provides a unique ID number for each topic area supported by the site This is the primary key for the Topics table
|
|
|
|
| ALL RIGHTS RESERVED. Business Refinery (c) 2006 - 2010. | Terms of Use | Privacy Policy |