Nope, not when editing.
When you want to *display* all albums and pictures on a single page, you can use a nested Repeater or other data control as explained in the book. Here's a quick example (using
VB, but I hope you get the idea):
AllAlbums.aspx
Code:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="AllAlbums.aspx.vb" Inherits="AllAlbums" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<h1>All Albums</h1>
<asp:Repeater ID="AllAlbums" runat="server">
<ItemTemplate>
<h2>
<asp:Literal ID="Literal1" runat="server" Text='<%# Eval("Name")%>'></asp:Literal></h2>
<asp:Repeater ID="Pictures" runat="server" DataSource='<%# Eval("Pictures")%>'>
<ItemTemplate>
<h3><asp:Literal ID="Literal1" runat="server" Text='<%# Eval("Description")%>'></asp:Literal></h3>
<asp:Image ID="Image1" runat="server" ImageUrl='<%# Eval("ImageUrl")%>' />
</ItemTemplate>
</asp:Repeater>
</ItemTemplate>
</asp:Repeater>
</div>
</form>
</body>
</html>
And the code behind:
AllAlbums.aspx.
vb
Code:
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
Using db As New PlanetWroxModel.PlanetWroxEntities
AllAlbums.DataSource = db.PhotoAlbums.Include("Pictures").Where(Function(x) x.Pictures.Any())
AllAlbums.DataBind()
End Using
End Sub
This code gets all the albums and pictures (using Include("Pictures", so they are retrieved on the first sql statement and not separately for each album). I am using Any() to only retrieve albums that have at least one picture.
The markup then has a nested repeater that displays the pictures it gets from the outer repeater using Eval("Pictures"). I am just displaying the name, description and ImageUrl, but obviously you can modify the HTML to your liking.
The concepts used in this sample are all explained throughout the book, but let me know if you need any clarification.
Note: editing all albums at once is a lot more complex as you need to keep track of which album you're editing.
Cheers,
Imar