Display the list of articles on a webpage and linking to the full article's page
Once our "News Articles" are in the SQL table, any standard methodology can be used to display them on a web page, an RSS feed or a Windows form. For this exercise we will create two simble pages, one to display the list of all articles and one to display the full article body. This example is done using ASP.NET in C#.
You can download the .NET project for this exercise from here.
8.1 To display the list of articles, create a new web form (e.g. ), drop in a standard control and bind the data columnd as shown below.
8.2 In the , create a with the list of articles form the SQL table and bind in to the control. That is it, you can now run the page and see the result.
8.3 For the article details page, the process is similar; we created a new web form () and added the necessary server controls to ( and controls); the code behind is also similar, the main difference is that we use the to pass the ID of the article to display.
Let's now look at the end result and some final comments.