Continuing from the last installment of this series, we will
work with the blog system mainly from the point of view of common user
management. Moreover, in the rest of this part we will summarize the key
techniques required to construct this sample blog system. To gain a better understanding
with this part let us again present to you the common user related modules to
Figure 1 - The common users related modules
When the user clicks "Back to Home" at the login
page, or at the first time he or she is navigated to the home page of this blog
system, the user enters into the system as the role of a common user. At this
time the user owns the right of viewing the blog list, reading the recommended
blogs and passengers' comments and words, making comments or even leaving words
to the blog host, all of which are previewed in Figure 1 in the first installment of this series.
You, in this case the unregistered user (a common surfer), now
come to the homepage index.aspx and will be shown around the mini blog system. Naturally,
the first view catching your sight may be the blog category and you can even skim
through some blog articles and make related comments upon them.
As you know, both of the above actions are concerning the
homepage index.aspx. Let us examine the first case.
Looking through the Blog Category
The blog category area is shown at the upper left corner of
page index.aspx. Figure 2 illustrates the related scrap of snapshot.
Figure 2 - The blog category block at the homepage
This part relates to the following HTML code.
<asp:DataList id="ClassList" runat="server">
<a href='index_<%#Eval("ST_c_name")%>_<%#Eval("ST_c_id") %>.aspx '>
Here, the frequently-used ASP.NET 1.X/2.0 server control DataList
comes into use. Partly due to that there are a great deal of sub items that
will be dropped here and partly due to that each of the items will be linked to
an array of blog articles to be shown at the right. I have tried to resort to
the url redirection technique to get over this puzzle. As you have seen, the
above complex href will be resolved into a piece of url scrap. With the url
redirection defined inside the file web.config, when the left sub blog item is
clicked then the user will be clicking a url scrap (a hyperlink) which will
show him or her the related articles belonging to this category. For details
about the url redirection, please refer to the "Key Techniques Dissection"
You may think that I have followed an awkward routine. If
so, you can solve it on you own.
To continue the story we look at reading interesting blogs
and making related comments.