There can be only one page directive

J

Jay

I'm currently reading ASP.NET Unleashed Second Edition and going through the
examples using the ASP.NET Web Matrix. I'm on chapter one doing the
Trace.aspx example and I get the following error message: There can be only
one 'page' directive.

Could someone please explain to me why I get this message? After I received
this message I went to the CDROM and copied the code from there and got the
same message again.

Here is the code from the book/CDROM:


<%@ Page Trace="True" %>
<Script Runat="Server">

Sub Page_Load
Dim strTraceMessage As String
Trace.Warn( "Page_Load event executing!" )
strTraceMessage = "Hello World!"
Trace.Write( "The value of strTraceMessage is " & strTraceMessage )
End Sub

</Script>

<html>
<head>
<title>Trace.aspx</title>
</head>
<body>

<h2>Testing Page Trace</h2>

<% Trace.Warn( "Rendering page content!" ) %>

</body>
</html>

Thank you!

--
"Some see the glass as half-empty;
some see the glass as half-full.
I see the glass as too big." - George Carlin

- J
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,025
Latest member
KetoRushACVFitness

Latest Threads

Top