Chapter 12 Uploading Doking's BLOG to the remote space
In order to make the Doking's BLOG program run normally after being uploaded to the remote space, here are some installation points.
1. The Doking's BLOG program provided in this tutorial is based on the site root directory. Since the web.config configuration file, bin directory and aspnet_client script library are used, these three files and directories must be placed in the site root directory in order to set the data. Forms validator runs normally.
2. The source program files of this tutorial are placed in the same directory as the web.config configuration file, bin directory and aspnet_client script library. The locations of these three files cannot be moved. If you want to place Doking's BLOG page in the second level under the root directory directory, such as this:
In the above address, the dkblog directory is where Doking's BLOG page files are placed. Except for the web.config configuration file, bin directory and aspnet_client script library, all other files are uploaded to the root directory. All can be copied to the dkblog directory.
3. Since Dreamweaver MX stores the string connecting to the database in the web.config configuration file, open the web.config configuration file, and you can see that the red circle in Figure 12-1 is the local physical path of the database.
Figure 12-1 Since part of the web.config configuration file
is uploaded to the remote space, its physical path is generally not the same as the local physical path. Server variables such as Server.MapPath cannot be used in the web.config configuration file to obtain the physical path of the database in the remote space.
You can use the following method to obtain the real directory physical path of the database on the remote host. Assume that the domain name address of the remote space when uploading is as follows:
http://www.pconline.com.cn/dkblog
Access the secondary directory dkblog of the remote virtual host through the above virtual address. The database file is saved in the dat folder, so in fact The virtual address is: http://www.pconline.com.cn/dkblog/dat
Create a new blank ASP.NET VB dynamic page in Dreamweaver, switch to the code view, and enter the following code:
<%=server.MapPath(" ") %>
Save it as dkurl.aspx and browse it in IE. The result is as shown in Figure 12-2.
Figure 12-2 Testing the physical path,
you can see that the physical path where dkurl.aspx is located is: Ddkblog, so the physical path of the database is naturally: D:dkblogdatdkblog.mdb.
After obtaining the physical path of the remote host, open the web.config configuration file and modify the physical path of the database.
Reminder: At this point, the program development of Doking's BLOG has been completed. The program is very simple but beneficial for beginners to develop databases. The actual application of the BLOG program is actually very complex, and many techniques require readers to ponder and study.