Section 20.4. Creating a Dynamic Page

20.4. Creating a Dynamic Page

Once you've set up an application server and a database server, you're ready to connect to the database, retrieve information, and display it on a Web page.

You already know the first step: Design an HTML page to display the database information. You can do this in any number of ways:

  • Choose File New to open the New Document window. Click the Dynamic Page category and double-click the appropriate dynamic page type: ASP VBScript, ColdFusion, PHP, or whatever. When you save the file, Dreamweaver automatically adds the proper extension: .asp for ASP pages, .aspx for ASP.NET, .cfm for ColdFusion, .jsp for JSP, or .php for PHP pages.

  • Right-click (Control-click) in the Site panel; choose New File from the shortcut menu. Dreamweaver creates a file in the correct server model format, with the proper extension.


Note: Just renaming a file in the Sites panel (from about.html to about.asp , for example) does not give the file the code necessary to apply the correct server model to the page. This is true for ASP, .NET, and JSP pages. (However, PHP and ColdFusion pages don't start life within any special code, so you could start with an .html page, change the extension to .php, and then add PHP programming.) More importantly, changing the file's extension (from .asp to .php, for example) doesn't change the page to the new server model, either, and probably "breaks" the page.

You can then use any of the page-building tools described in this booktables, Cascading Style Sheets, Library items, or whateverto design the page. Even though the file's officially an ASP page, it still contains lots of HTML. Unlike a plain- vanilla HTML page, though, this one also contains the server-side programming code that lets the page communicate with a database.

You can edit the newly created page using either Design view or Code view. But before you can add dynamic content to a page, you must create a connection to a database.



Dreamweaver 8[c] The Missing Manual
Dreamweaver 8[c] The Missing Manual
ISBN: 596100566
EAN: N/A
Year: 2006
Pages: 233

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net