Ok, we now have a database for the BDSWebExample set up. Our next task is to create a virtual directory.
IIS, virtual directory, Web Server?
ASP.NET Web forms (pages) use HTTP to communicate between the browser (client) and the Web server. As stated in the first chapter of this course, ASP.NET Web Forms are text files with a ".aspx" file extension. When a user first accesses the Forms page over the web, ASP.NET generates a compiled DLL file that then dynamically generates HTML output for browsing - deployed throughout an IIS virtual root directory tree.
Most Web designers/developers start out by learning client-side technologies like HTML, JavaScript, CSS, etc. When a browser requests a web page created with client-side technologies, the Web server simply serves the (HTML) files that the browser requests.
Server-side technologies like ASP.NET are different. The code in the ASP.NET Web page is read by the server and used to dynamically generate standard HTML (and JavaScript, CSS, ...) that is then sent to the browser.
Using IIS (Internet Information Server)
IIS is an optional Windows component in non-server operating systems (Win XP Pro, Win 2000 Pro, etc). You can use Control Panel's Add or Remove Windows components to install IIS.
The next steps show you how to mark a directory as an (web) application root directory using Internet Information Services (IIS).
Note: the steps show how to build a virtual directory for the BDSWebExample application.
1. Run IIS (Start - Run - inetmgr.exe)
2. Expand the local computer node, expand Web Sites.
3. Right click "Default Web Site", select "New - Virtual directory"
4. In the "Virtual Directory Creation Wizard", click Next.
5. Enter "BDSWebExample" in the Alias edit box, then click Next.
6. Enter "C:\Inetpub\wwwroot\BDSWebExample" (note that the original code is in "C:\Program Files\Borland\BDS\2.0\Demos\DB\ASPPortal\BDSWebExample") for the web site content directory, then click Next.
7. On the "Access permissions" page click Next. Then we're done (click Finish).
Using Cassini
If you do not have IIS installed, you can use the Cassini web server that ships with Delphi.
After you have compiled the Cassini web server, you can start it by running the CassiniWebServer.exe in the "C:\Program Files\Borland\BDS\2.0\Demos\Cassini" folder.
"Applications directory" should point to "C:\Inetpub\wwwroot\BDSWebExample", leave the "Server Port" on 80, set "Virtual root" to "/BDSWebExample":
Running BDSWebExample!
Finally, we are ready to run the BDSWebExample for the first time - note that we have not used Delphi today.
If you are using IIS, simply start your browser, and in the address bar write "http://localhost/bdswebexample/default.aspx" ...
If you are using Cassini, hit the "Start button" - then "click to browse: http://localhost:80/bdswebexample" (and the browser will be opened for you). You'll get the directory listing, find the default.aspx link and click on it...
This is what you should see (browse around, get accustomed with the pages):