Now that you have three working pagesFolders.csp, Reports.csp, and Menu.cspit is time to put them all together. Cut and paste the following into a new CSP file and save it as Home.csp. This file will define the frames for the home page.
To download the CSP files from this tutorial, click TutorialSamples.zip. For more information, see Code examples.
<META HTTP
<link REL=STYLESHEET TYPE='text/css' HREF='tut.css'>
<!-- #include file=helper_js.csp -->
CurrentFolderID = Request.QueryString.Item("FolderID");
//Load the top frame with menu.csp so that it can display the
//full path to the current folder.
Response.Write ("<FRAME Name='Header' Target='Contents' " +
"Src='Menu.csp
Response.Write ("<FRAMESET Cols='180,*'>");
// Load the folders portion of the page so that it can display
// a list of sub
Response.Write ("<FRAME Name='Contents' Target='main' " +
"Src='Folders.csp
// Load the reports portion of the page so that it can display
// a list of the reports contained within the current folder.
Response.Write ("<FRAME Name='Main' Target='main'" +
"Src='Reports.csp
Note that the source of the frame named Contents points to your Folders.csp file with the FolderID
equal to the CurrentFolderID
.
Response.Write ("<FRAME Name='Header' Target='Contents' " +
"Src='Menu.csp
Also recall that earlier in the tutorial, in the section Redirecting the user to the site's home page, the Logon.csp page redirects the user to Home.csp, and that a particular line was unusual in that it included a question mark.
Response.Redirect ("Home.csp
The line loads the frames file with the parameter FolderID
equal to zero. This ensures that when the page is first loaded, both the folders page and the reports page will load the folders and reports at the very top level of the folder tree.
Saving and viewing the Tutorial Desktop
Crystal Decisions, Inc. http://www.crystaldecisions.com Support services: http://support.crystaldecisions.com |