Ifrk ljjIW i

Cpr r i*'T pfriET iqdl AM vtyttjc -r. L' v - j T- _ J e e kv r. L'.' in- irr id e . dw i ftx gJ 1 - icl krf bo tmmiiw t> M e wffi W* fit Figure 9-13 The Welcome to the CMS.NET Setup Web page The next setup Web page requests where to find its database (see Figure 9-14). On this Web form, you will enter the following Figure 9-14 The configure database Web page Database The name you gave the database. It defaults to CMSNET. Data Source The server where the database is housed. If it is on your...

The Aut List Web Page

When designing the AutList.aspx page, I had the option of creating the entire list and headings in C code. Instead, I decided to use the design tool to create the static table headers and then have the code append all the content list information. This approach not only simplifies the code, but it also allows a graphic designer to decide on colors and fonts for the headers, as well as the image for the function buttons found in the right four columns. Listing 11-3 shows the design code used to...

Nav Bar Update for Handling Roles

When you create a NavBar, it doesn't make sense to allow navigation to areas of the Web site for which the user does not have authorization. This will only confuse and frustrate the user. So let's give NavBar.aspx a minor facelift so that it only displays menus the user can access. First, you need to make a small change to CMAMenu.xml (see Listing 12-18). You need to add an optional element of < authorization > directly after the < Menu > element. If this element is present, the NavBar...

What Is Personalization

For such a simple term, personalization gets a lot of play in the Web world. Most major Web sites on the Internet have, or are implementing, some type of personalization. For example, Chapter 1 described how MSNBC's Web site implements some personalization on its cover page by providing content based on the user's ZIP code. However, that is just one of many types of personalization. Let's take a step back and define exactly what personalization is Personalization is the process of using...

Create

The account administration would be quite useless if you couldn't create a new account. Figure 12-5 shows the AdmAcntCreate Web page that is designed for this task. n Adjnhiiitrai amp rj . Uidliui Crcatt Tr'j i l- L -L-I K in n i. ' v.Li MI M I Figure 12-5 The AdmAcntCreate Web page Looking at Figure 12-5, you should spot something you haven't used before the multiselect list box. The list box stores all the possible roles in the system that a user can have. Listing 12-21 shows the design code...

Reading an XML File Using Xml TextReader

Open the code for ReadXML in the edit window. Nothing should be new to you. For ReadXML, you need to add the XML namespace. The code is just like adding any other namespace using System.Web.UI.HtmlControls using System.Xml From here on, all the code you are going to add will be found within the IsPostBack if statement in the Page_Load method. The first thing you need to do is open up the XML stream in an XmlTextReader so that it can be read. The method is quite straightforward. Basically, pass...

Programmatically Updating a webconfig File Setupsetup2cs

The updateConfigWeb method handles all the gory details of updating the web.config file. It takes as parameters all the values that will be placed in the web.config file. public void UpdateConfigWeb String database, String datasource, String userid, String password, String timeout It then opens the web.config file, loads it into an XmlDocument for processing, and closes it so that it may be opened later for writing. XmlDocument doc new XmlDocument The first thing it does is look for the lt...

The Setupsetup4cs Codebehind

Setup4 still requires a little bit of work before it is free to display the cheery message of successful completion. It needs to set the lt appSettings gt add setup attribute value in the web.config file to true. By setting it to true, the admin.aspx which was discussed at the beginning of the chapter knows that it can now run CMS.NET's administration system. The code for the Page_Load method see Listing 10-22 is virtually the same as the updateConfigWeb method found in setup2.cs. First, you...