I am doing the last try it out in chapter 15, "Using the cache API" I have A problem with the Title. the book tells me to remove the title attribute completely from the page directive because I am going to set it Programmatically so i do and carefully follow every step through the try it out and then at then end i get an error saying "Object reference is set to an instance of an object" but if i give the ViewDetails.aspx page a title it works just fine.

I don't know what I'm missing though so hope yall can. here is the code behind and html for All.aspx and ViewDetails.aspx.
(ViewDetails.aspx HTML Beginning)
<%@ Page Language="
VB" MasterPageFile="~/MasterPages/Frontend.master" AutoEventWireup="false" CodeFile="ViewDetails.aspx.
vb" Inherits="Reviews_ViewDetails" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cpMainContent" Runat="Server">
<asp:Label ID="Label1" runat="server" Text=""></asp:Label>
<h1><asp:Label ID="TitleLabel" runat="server"></asp:Label></h1>
<asp:Label ID="SummaryLabel" runat="server" CssClass="Summary"></asp:Label>
<asp:Label ID="BodyLabel" runat="server"></asp:Label>
</asp:Content>
(ViewDetails.aspx HTML ending)
(VeiwDetails.aspx Code behind)
Imports PlanetWroxModel
Partial Class Reviews_ViewDetails
Inherits BasePage
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
Dim reviewId As Integer = Convert.ToInt32(Request.QueryString.Get("ReviewId" ))
Dim myReview As Review = TryCast(Cache("Reviews" + reviewId.ToString()), Review)
Label1.Text = "In the cache"
If myReview Is Nothing Then
Label1.Text = "NOT in the cache"
Using myEntities As New PlanetWroxEntities()
myReview = (From r In myEntities.Reviews
Where r.Id = reviewId
Select r).SingleOrDefault()
If myReview IsNot Nothing Then
Cache.Insert("Reviews" + reviewId.ToString(), myReview, Nothing,
DateTime.Now.AddMinutes(20),
System.Web.Caching.Cache.NoSlidingExpiration)
End If
End Using
End If
If myReview IsNot Nothing Then
TitleLabel.Text = myReview.Title
SummaryLabel.Text = myReview.Summary
BodyLabel.Text = myReview.Body
Title = myReview.Title
MetaDescription = myReview.Summary
End If
End Sub
End Class
(ViewDetails.aspx code behind ending)
(All.aspx HTML Beginning)
<%@ Page Title="All Reviews" Language="
VB" MasterPageFile="~/MasterPages/Frontend.master" AutoEventWireup="false" CodeFile="All.aspx.
vb" Inherits="Reveiws_All" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cpMainContent" Runat="Server">
<asp:Repeater ID="Repeater1" runat="server">
<ItemTemplate>
<asp:HyperLink ID="HyperLink1" runat="server"
NavigateUrl='<%# "ViewDetails.aspx?ReviewId=" + Eval("Id").ToString() %>'
Text='<%# Eval ("Title") %>'></asp:HyperLink>
<br />
</ItemTemplate>
</asp:Repeater>
</asp:Content>
(All.aspx HTML ending)
(All.aspx Code Behind beginning)
Imports PlanetWroxModel
Partial Class Reveiws_All
Inherits BasePage
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
Using myEntities As New PlanetWroxEntities()
Dim allReviews = From review In myEntities.Reviews
Where review.Authorized = True
Order By review.CreateDateTime Descending
Select review
Repeater1.DataSource = allReviews
Repeater1.DataBind()
End Using
End Sub
End Class
(All.aspx Code behind ending)
Hope yall can help!