title: What could be causing an XML Parsing Error: no element found?
body: <p>I recently migrated an ASP site from my dev machine to a live server.  All the pages except my FAQ page works just fine, but my FAQ brings up:</p>
  
  <pre><code>XML Parsing Error: no element found
  Location: http://geniusupdate.com/GSHelp/faq.aspx
  Line Number 1, Column 1:
  </code></pre>
  
  <p>The only changes I have made were changing the connection string on my SQL page from local to the string specified by my hosting service.  Any tips on what I can do to find the root of this issue?</p>
  
  <p>here is the source to my FAQ page:</p>
  
  <pre><code>&lt;%@ Page Language="VB" MasterPageFile="~/theMaster.master" AutoEventWireup="false" CodeFile="faq.aspx.vb" Inherits="faq" Title="Untitled Page" %&gt;
  &lt;%@ Import Namespace="sqlstuff" %&gt;
  &lt;%@ Import Namespace="functions" %&gt;
  
  &lt;asp:Content ContentPlaceHolderID="page_title" ID="theTitle" runat="server"&gt;
      FAQ&lt;/asp:Content&gt;
  &lt;asp:Content ContentPlaceHolderID="column1_title" ID="col1Title" runat="server"&gt;
      &lt;%=faqPageTitle(Request.QueryString("cid"))%&gt;&lt;/asp:Content&gt;
  &lt;asp:Content ContentPlaceHolderID="column1" ID="columnContent" runat="server"&gt;
  
       &lt;p&gt;Click on a question to expand it to see the answer!&lt;/p&gt;
       &lt;p&gt;&lt;%  If cID &gt;= 0 Then
                  Dim theFaq As New List(Of faqContent), iterate As Integer = 0
                  theFaq = sqlStuff.getFaqs(cID)
                  For Each oFaq As faqContent In theFaq
                      Response.Output.WriteLine("&lt;h4 id={0} class={1}&gt;Q: {2}&lt;/h4&gt;", _
                                                   addQuotes("gsSwitch{0}-title", iterate), _
                                                   addQuotes("handCursor"), _
                                                   oFaq.Content.Question)
                      Response.Output.WriteLine("&lt;div id={0} class={1}&gt;&lt;string&gt;A: &lt;/strong&gt;{2}&lt;/div&gt;", _
                                                   addQuotes("gsSwitch{0}", iterate), _
                                                   addQuotes("gsSwitch"), _
                                                   oFaq.Content.Answer)
  
                      iterate += 1
                  Next
              Else
                  Response.Output.Write("Here you can find a lot of information about eTHOMAS and how to expedite your office tasks.{0}", ControlChars.NewLine)
              End If
      %&gt;&lt;/p&gt;
      &lt;script type="text/javascript"&gt;
          var gsContent = new switchcontent("gsSwitch", "div")
          var eID = '&lt;%= expandID %&gt;'
          gsContent.collapsePrevious(true) // TRUE: only 1; FALSE: any number
          gsContent.setPersist(false)
          if(eID &gt;= 0){
              gsContent.defaultExpanded(eID) // opens the searched FAQ
              document.getElementById('gsSwitch' + eID + '-title').scrollIntoView(true) // scrolls to selected FAQ
          }        
          gsContent.init()
      &lt;/script&gt;
  &lt;/asp:Content&gt;
  &lt;asp:Content ContentPlaceHolderID="subcolumn_right_title" ID="rSideColTitle" runat="server"&gt;&lt;/asp:Content&gt;
  &lt;asp:Content ContentPlaceHolderID="subcolumn_right" ID="rSideColContent" runat="server"&gt;&lt;/asp:Content&gt;
  &lt;asp:Content ContentPlaceHolderID="subcolumn_left_title" ID="lSideColTitle" runat="server"&gt;&lt;/asp:Content&gt;
  &lt;asp:Content ContentPlaceHolderID="subcolumn_left" ID="lSideColContent" runat="server"&gt;&lt;/asp:Content&gt;
  &lt;asp:Content ContentPlaceHolderID="sidecolumn_title" ID="sideColtitle" runat="server"&gt;
  &lt;/asp:Content&gt;
  &lt;asp:Content ContentPlaceHolderID="sidecolumn" ID="sideCol" runat="server"&gt;
      &lt;%  If cID &gt;= 0 Then
              Response.Write(constructFaqSideMenu(CInt(Request.QueryString("cid"))))
          Else
              Response.Write(constructFaqSideMenu())
          End If
      %&gt;
  &lt;/asp:Content&gt;
  </code></pre>
  
  <p>I found this on another forum <a href="http://dev.communityserver.com/forums/t/472596.aspx" rel="noreferrer">link</a>: </p>
  
  <blockquote>
    <p>Well, it appears it's a bit of both. The message is generated by Firefox, but caused by the framework. For some reason, .NET generates a response type of "application/xml" when it creates an empty page. Firefox parses the file as XML and finding no root element, spits out the error message.</p>
  </blockquote>
  
  <p>IE does not render the page, period.  This is where the XML is coming from.</p>
  
  <p>Here is the constructFaqSideMenu() function:</p>
  
  <pre><code>Public Shared Function constructFaqSideMenu(ByVal oSelID As Integer) As String
      Dim oCatList As New List(Of faqCategory)
      Dim oRet As New StringBuilder
      Dim iterate As Integer = 1, extraTag As String = ""
  
      oCatList = sqlStuff.getFaqCats
  
      oRet.AppendFormattedLine("&lt;ul id={0}&gt;", addQuotes("submenu"))
      oRet.AppendFormattedLine("    &lt;li id={0}&gt;FAQ Categories&lt;/li&gt;", addQuotes("title"))
      For Each category As faqCategory In oCatList
          If iterate = oSelID Then
              extraTag = String.Format(" id={0}", addQuotes("active"))
          Else
              extraTag = ""
          End If
          oRet.AppendFormattedLine("    &lt;li{0}&gt;&lt;a href={1}&gt;{2}&lt;/a&gt;&lt;/li&gt;", extraTag, addQuotes("faq.aspx?cid={0}", iterate), StrConv(category.Title,         VbStrConv.ProperCase))
          iterate += 1
      Next
      oRet.AppendLine("&lt;/ul&gt;")
  
      Return oRet.ToString
  End Function
  </code></pre>
  
  <p>And here is the source of the blank page IE returns:</p>
  
  <pre><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"&gt;
  &lt;HTML&gt;&lt;HEAD&gt;
  &lt;META http-equiv=Content-Type content="text/html; charset=windows-1252"&gt;&lt;/HEAD&gt;
  &lt;BODY&gt;&lt;/BODY&gt;&lt;/HTML&gt;
  </code></pre>