The problem I'm having, is that my page is outputting my data, before the <html> ... </html> tags. So, my stuff comes out, and then IIS is sending out the normal HTML content.
How can I have my page output data inside the html and body tags ?

VB Code:
  1. Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load    
  2.         Dim strArr() As String : strArr = Split(Request.QueryString("Code"), ",")
  3.         Dim strTableName As String, strSQLStatement
  4.         Dim myConnection As New SqlConnection(ConfigurationSettings.AppSettings("ConnectionString"))
  5.         Dim lngTemp As Long : myConnection.Open()
  6.  
  7.         Select Case strArr(0)
  8.             Case "1" : strTableName = "tblMasterHeaders"
  9.             Case "2" : strTableName = "tblSecondaryHeaders"
  10.             Case "3" : strTableName = "tblThirdHeaders"
  11.             Case "4" : strTableName = "tblThirdHeaders"
  12.         End Select
  13.         lngTemp = strArr(0)
  14.         If Not strTableName = vbNullString Then
  15.             strSQLStatement = "SELECT * FROM " & strTableName & vbCrLf
  16.             If Not strTableName = "tblMasterHeaders" Then
  17.                 If strArr(0) = 4 Then
  18.                     strSQLStatement += "WHERE lngCurrentIndex = " & strArr(1)
  19.                 Else
  20.                     strSQLStatement += "WHERE lngParentIndex = " & strArr(1)
  21.                 End If
  22.             End If
  23.             Dim myCommand As New SqlCommand(strSQLStatement, myConnection)
  24.             Dim myReader As SqlDataReader : myReader = myCommand.ExecuteReader()            
  25.             Try
  26.                 While myReader.Read()
  27.                     If lngTemp = 1 Then
  28. [b]                        Response.Write(strGenerateHeaderLink(2, strArr(1), myReader.GetValue(2)) & vbCrLf & vbCrLf)[/b]
  29.                     ElseIf lngTemp = 2 Then
  30. [b]                        Response.Write(strGenerateHeaderLink(3, myReader.GetValue(0), myReader.GetValue(2)) & vbCrLf)[/b]
  31.                     ElseIf lngTemp = 3 Then
  32. [b]                        Response.Write(strGenerateHeaderLink(4, myReader.GetValue(0), myReader.GetValue(2)) & vbCrLf)[/b]
  33.                     ElseIf lngTemp = 4 Then
  34.                         Dim strSAPCodes() As String = Split(myReader.GetValue(3), ",")
  35.  
  36.                         Response.Write(strSendComment("start of productTableHeader.html"))
  37.                         Response.WriteFile("productTableHeader.html")
  38.                         Response.Write(strSendComment("end of productTableHeader.html"))
  39.  
  40.                         Dim strTableLocation As String
  41.                         strTableLocation += "<tr>" & vbCrLf
  42.                         strTableLocation += "<td width=" & Chr(34) & "90%" & Chr(34) & " colspan=" & Chr(34) & 5 & Chr(34) & ">" & strDoFormatting(Replace(strGetProduct(strSAPCodes(0), modMisc.prodDetailsEnum.strSectionText), "|", " &nbsp; &gt;&gt; &nbsp; ")) & "</td>" & vbCrLf
  43.                         strTableLocation += "</tr>" & vbCrLf
  44.                         Response.Write(strTableLocation)
  45.  
  46.                         Dim i As Long
  47.                         For i = 0 To UBound(strSAPCodes)
  48.                             Response.Write(strGetProductDescriptionBySAPCode(strSAPCodes(i)) & vbCrLf)
  49.                         Next
  50.  
  51.                         Response.Write(strSendComment("start of productTableFooter.html"))
  52.                         Response.WriteFile("productTableFooter.html")
  53.                         Response.Write(strSendComment("end of productTableFooter.html"))
  54.                     End If
  55.                 End While
  56.             Finally
  57.                 myReader.Close()
  58.                 myConnection.Close()
  59.             End Try
  60.         End If
  61.     End Sub

The above code is coming out as :

Code:
<a href="ProductGroup.aspx?Code=2,1">Backup Solutions</b><br><a href="ProductGroup.aspx?Code=2,2">Boards (video, sound, .)</b><br><a href="ProductGroup.aspx?Code=2,3">CAD Peripherals</b><br><a href="ProductGroup.aspx?Code=2,4">CAD Software</b><br><a href="ProductGroup.aspx?Code=2,5">Connectivity (hub, switch, router,.)</b><br><a href="ProductGroup.aspx?Code=2,6">Courses & Training</b><br><a href="ProductGroup.aspx?Code=2,7">CPU, memory, SIMMs,.</b><br><a href="ProductGroup.aspx?Code=2,8">Drives (FD, HD, etc.)</b><br><a href="ProductGroup.aspx?Code=2,9">Entertainment Software</b><br><a href="ProductGroup.aspx?Code=2,10">Extended Warranty</b><br><a href="ProductGroup.aspx?Code=2,11">Handhelds & Notepads</b><br><a href="ProductGroup.aspx?Code=2,12">Keyboards, Mice, etc.</b><br><a href="ProductGroup.aspx?Code=2,13">Monitors & Displays</b><br><a href="ProductGroup.aspx?Code=2,14">Networking Hardware</b><br>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
	<HEAD>
		<title></title>
		<meta name="GENERATOR" content="Microsoft Visual Studio.NET 7.0">
		<meta name="CODE_LANGUAGE" content="Visual Basic 7.0">
		<meta name="vs_defaultClientScript" content="JavaScript">
		<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
	</HEAD>
	<body MS_POSITIONING="GridLayout">
	</body>
</HTML>