p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 (http://p2p.wrox.com/forumdisplay.php?f=389)
-   -   Chap 16 pg 574: Elements not supported Elements not known (http://p2p.wrox.com/showthread.php?t=75588)

tomche August 6th, 2009 02:29 PM

Chap 16 pg 574: Elements not supported Elements not known
 
Hello All,

I have done the code on pg 574 and I get a series of errors under HTML elements
The first Repeater is underlined and when I mouseover it says
"Element Repeater is not a known element. This can occur if there is a compilation error or the web.config is missing.

The first ItemTemplate is underlined and mouseover generates the following error
Validation (XHTML 1.0 Transitional Element "ItemTemplate is not supported"

Hyperlink is also coming up as "not a known element"
as too is PlaceHolder

My Default.aspx code looks like this
Code:

<%@ Page Language="C#" MasterPageFile="~/MasterPages/MasterPage.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" Title="Welcome to Planet Wrox" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<asp:Content ID="Content2" ContentPlaceHolderID="cpMainContent" Runat="Server">
<asp:Repeater ID="Repeater1" runat="server">
<HeaderTemplate>
<p>Below you find a list with Reviews for your favourite music genres.</p>
</HeaderTemplate>
<ItemTemplate>
<h3><asp:Literal ID="Literal1" runat="server"
Text='<%# Eval("Name") %>'></asp:Literal></h3>
<asp:Repeater ID="Repeater2" runat="server" DataSource='<%# Eval("Reviews")%>'>
<ItemTemplate>
<asp:HyperLink ID="HyperLink1" runat="server" Text='<%# Eval("Title") %>'
NavigateUrl='<%# "ViewDetails.aspx?ReviewId=" + Eval("Id").ToString() %>'>
</asp:HyperLink><br />
</ItemTemplate>
</asp:Repeater>
</ItemTemplate>
</asp:Repeater>
<asp:PlaceHolder ID="plcNoRecords" runat="server" Visible="false">
<p>Sorry no Reviews were found. You either didn't set your favourite genres or you may need to log in first.</p>
</asp:PlaceHolder>
<p>You can change your genre preferences <a href="~/MyProfile.aspx" runat="server">here</a></p>
</asp:Content>
<h1>Hi there visitor and welcome to Planet Wrox</h1>
<p class="Introduction">
We're glad you are paying a visit to <a href="http://www.PlanetWrox.com">
www.PlanetWrox.com</a>, the coolest music community site on the Internet.
</p>
<p class="Introduction">
Feel free to have a <a href="Default.aspx">look around</a>; as there are lots of
interesting <b>reviews and concert pictures</b> to be found here.
</p>
<p>
You can <a href="Login.aspx">log in</a> here
</p>
</asp:Content>

Heeelllp.

Cheers

Thomas

Imar August 6th, 2009 02:48 PM

Hi Thomas,
Your first </asp:Content> has gone travelling. Take a look at this:

Code:

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<asp:Content ID="Content2" ContentPlaceHolderID="cpMainContent" Runat="Server">

Notice how Content1 is missing its closing tag. I wonder where it's gone?

Look down a bit and you find this:

Code:

<p>You can change your genre preferences <a href="~/MyProfile.aspx" runat="server">here</a></p>
</asp:Content> <!-- See this?? -->
<h1>Hi there visitor and welcome to Planet Wrox</h1>

Oh, there it is. Cut it from this location, and paste it after the first opening Content tag and you're good to go...

Hope this helps.

Imar


All times are GMT -4. The time now is 03:13 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.