XML Parsing Error: not well-formed

I have WinXP Pro SP2.

I downloaded and installed Visual Web Developer 2005 Express Edition.

I am going through the Walkthroughs to better understand ASP.NET.

I got to the Walkthrough: Creating a Web Site with Membership and User Login (ms-help://MS.VSExpressCC.v80/MS.NETFramework.v20.en/dv_vwdcon/html/296c0be6-9ad5-4104-9a1b-a853986fa1a3.htm)

I performed every step up toTesting Login flawlessly (and every other Walkthrough up to this point). When I press Ctrl+F5 to run the Website I get this error:

XML Parsing Error: not well-formed
Location:http://localhost/membership/Default.aspx
Line Number 1, Column 2:<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
-^

I can't find any additional information on the problem in the MS Knowledge Bases so I don't know how to fix it. Suggestions?

[1223 byte] By [notamused] at [2007-12-28]
# 1

What we see that somehow ASPX file is parsed by XML parser.

ASPX is not an XML and so this error is expected from XML parser.

I'd recommend you to go to http://forums.asp.net/ to find why this happens.

SergeyDubinets-MSFT at 2007-9-4 > top of Msdn Tech,.NET Development,XML and the .NET Framework...
# 2
.ASPX files can be XML and can be parsed using XML parser. Example:

<%@ Page Language="VB" %>
<script language="VB" runat="server">
Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
'Set response to XML
Response.ContentType = "text/xml"
Dim dt As New System.Data.DataTable
Try
'Set connection string
Dim connStr As String = "Data Source=ServerName;Initial Catalog=DatabaseName;User ID=UserName;Password=Password"
'Set Select statement
Dim sql As String = "SELECT * FROM caddb.dbo.GetVehicles()" 'Selects from the table valued function GetVehicles
'Create Data Adapter specifying the select statement and connection string
Dim da As New System.Data.SqlClient.SqlDataAdapter(sql, connStr)
'Fill the DataTable with data
da.Fill(dt)
Catch ex As Exception
'If connection failed, write the error instead
Response.Write("<Vehicles><error>")
Response.Write(ex.ToString)
Response.Write("</error></Vehicles>")
Exit Sub
End Try
'Write the XML Version info not required but is sujested
Response.Write("<?xml version='1.0' encoding='utf-8' standalone='yes'?>")
'Write the parent node begin
Response.Write("<Vehicles>")
For Each row As System.Data.DataRow In dt.Rows 'Cycle through the rows of the data table
writeRowXML(row) 'Write the row to XML
Next
'Write the parent node end
Response.Write("</Vehicles>")

End Sub
Sub writeRowXML(ByRef row As System.Data.DataRow)
Response.Write("<Vehicle>")
Response.Write(" <lat>" + row.Item("lat").ToString + "</lat>")
Response.Write(" <lng>" + row.Item("lng").ToString + "</lng>")
Response.Write(" <speed>" + row.Item("speed").ToString + "</speed>")
Response.Write(" <heading>" + row.Item("heading").ToString + "</heading>")
Response.Write(" <time>" + row.Item("time").ToString + "</time>")
Response.Write("</Vehicle>")
End Sub
</script>

The resulting file would be XML. It would look like this:

<Vehicles>
<Vehicle>
<lat>35.3738301</lat>
<lng>-97.1908954</lng>
<speed>0</speed>
<heading>0</heading>
<time>12/2/2006 1:42:30 AM</time>
</Vehicle>
<Vehicle>
<lat>35.3838409</lat>
<lng>-97.1908963</lng>
<speed>45</speed>
<heading>180</heading>
<time>12/2/2006 1:42:30 AM</time>
</Vehicle>
</Vehicles>

UncannyVagabond at 2007-9-4 > top of Msdn Tech,.NET Development,XML and the .NET Framework...

.NET Development

Site Classified