Creating the Slideshow Viewer Page


Now that you understand how you ll use database data for the slideshow, you can proceed with creating the slideshow viewer page. You ve already created a slideshow page (two, in fact), and you can use the slideshow page you created in Chapter 5 as a starting point. I suggest that you make a copy of that slideshow page but rip out all the code and start over with the programming part it s probably easier to start over with the code than it would be to make a lot of fiddly changes to existing code.

I also suggest that you add three new controls to the page: a Label control that you can use to display the slideshow title; a second Label control that you can use to display the slide date, if there is a date; and a hyperlink that takes the user back to the slideshow picker page. When running, the new slideshow viewer page might look like the page shown in Figure 12-5.

click to expand
Figure 12-5: The slideshow viewer page, which includes a title, a date, and a link to the slideshow picker page.

Our first task will be to find an existing slideshow page. Then we ll add the controls I just suggested.

Create the slideshow viewer page

  1. Using Windows Explorer, make a copy of the  Slideshow1.aspx file you created in Chapter 5, and name the new copy SlideshowViewe  Slideshow1.aspxr.aspx. Put the new copy in the C:\WebMatrix folder. If you don t have  Slideshow1.aspx on your disk, make a copy of the file on the companion CD.

  2. In Web Matrix, open the  SlideshowViewer.aspx page.

  3. Change the heading to Slideshow Viewer.

  4. Press ENTER to create a blank line under the heading, and then drag a Label control to the blank line. Set the Label control s ID property to labelSlideshowTitle and clear its Text property. You ll use this new label to display the slideshow title passed from the slideshow picker. This Label control can also do double duty by displaying error messages. If you want, format the Label control with a font and color.

  5. Drag another Label control onto the same line as the slide caption. Clear the Label control s Text property, and set its ID property to labelSlideDate.

  6. Create another blank line, and drag a Hyperlink control onto the blank line. Set the Hyperlink control s Text property to Return to slideshow picker and set its NavigateUrl property toSlideshowpicker.aspx . Set the control s ID property to linkReturnToPicker. (We won t be programming this hyperlink, so setting its ID property isn t all that important.)

When you ve finished, the page will look like Figure 12-6.

click to expand
Figure 12-6: The slideshow viewer page in Design view after you ve added new controls.

As I said earlier, the slideshow viewer page will look quite similar to the other slideshow pages you ve created. The significant changes to the slideshow viewer page are in the code that you re about to write.




Microsoft ASP. NET Web Matrix Starter Kit
Microsoft ASP.NET Web Matrix Starter Kit (Bpg-Other)
ISBN: 0735618569
EAN: 2147483647
Year: 2003
Pages: 169
Authors: Mike Pope
BUY ON AMAZON

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