I am receiving the following errors in my code. I'm trying to copy just portions of the ASP at a time into ASP.NET and fix errors as I go. I'm receiving a Statement cannot appear within a method body. End of method assumed. followed by a 'End Sub' must be preceded by a matching 'Sub' on the following code. Please Help!!!!

<%@ Page Language="VB" MasterPageFile="~/BlankLayout.master" AutoEventWireup="false" CodeFile="reports-shipping.aspx.vb" Inherits="reports_shipping" title="AMNet Final Shipping Reports" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeaderTitle" Runat="Server">
AMNet Final Shipping Reports
<asp:Content ID="Content2" ContentPlaceHolderID="SectionTitle" Runat="Server">
<script type="text/javascript" language="JavaScript">
function gfRefreshBranch()
	var theForm = document.forms["ReportsSelection"];
	var branchSelection=theForm.Branch.value;
	window.location = "reports-shipping.asp?Branch=" + branchSelection;
function gfRefreshSalesDate()
	var theForm = document.forms["ReportsSelection"];
	var branchSelection=theForm.Branch.value;
	var salesDateSelection=theForm.SalesDate.value;
	window.location = "reports-shipping.asp?Branch=" + branchSelection + "&" + "SalesDate=" + salesDateSelection;
function SortVBArray(arrVBArray) {
        return arrVBArray.toArray().sort().join('\b');
<!--#include file="incASP/gfConvertDate.inc"-->
<!--#include file="incASP/gfMapURL.inc"-->

<script type="text/javascript" language="JavaScript">

dim gvReportsFolder, gvReportsFolderPath, gvBranchSelected, gvServerFolder, gvServerFolderPath, gvBranchFolder, gvNumReports, gvSalesDateSelected
    Dim gaReportsPath(999), gaReportsDateLastModified(999), gaReportsSize(999), gaReportsDesc(999), gaReportsSalesDay(999)
    Dim gvBranchFolderPath
dim fs, itemFiles, wvStr, url, strLoc, strLen, kbSize, wvFileDate, fileDate, fileTime, i, itemFolders, lastFileDate, itemNumber, B, strBranch
dim sorter
dim plantFolder(7)
plantFolder(0) = "001-JacksonPT"
plantFolder(1) = "002-PlymouthPT"
plantFolder(2) = "003-KalamzooPT"
plantFolder(3) = "004-SidneyPT"
plantFolder(4) = "005-ColdwaterPT"
plantFolder(5) = "006-FortWaynePT"
plantFolder(6) = "008-ColdwaterPT"

dim plantDesc(7)
plantDesc(0) = "Jackson"
plantDesc(1) = "Plymouth"
plantDesc(2) = "Kalamazoo"
plantDesc(3) = "Sidney"
plantDesc(4) = "Coldwater I"
plantDesc(5) = "Fort Wayne"
plantDesc(6) = "Coldwater II"

'/Check for Development System or Production
strLoc= InStr(LCase(Request.ServerVariables("PATH_INFO")),"/dev/")
if strLoc = 0 Then
	'/production files
	gvServerFolderPath = "c:\inetpub\wwwroot\shippingreports"
	'/development files
	gvServerFolderPath = "c:\inetpub\wwwroot\dev\shippingreports"
End If

gvBranchSelected = Request.QueryString("Branch")

gvSalesDateSelected = Request.QueryString("SalesDate")

    If gvSalesDateSelected = "" Then
        	gvSalesDateSelected = gfConvertDate(Date,0)
    End If

    fs = CreateObject("Scripting.FileSystemObject")

gvNumReports = -1

if gvBranchSelected = "" Then
	gvReportsFolderPath = ""
    gvBranchFolderPath = gvServerFolderPath & "\" & gvBranchSelected

	for i = 0 to 6
		gvReportsFolderPath = gvBranchFolderPath & "\" & plantFolder(i)

            gvReportsFolder = fs.GetFolder(gvReportsFolderPath)
	    for each itemFiles in gvReportsFolder.Files	
			if InStr(itemFiles.Type,"Adobe") > 0 Then
				gvNumReports = gvNumReports + 1
				gaReportsDesc(gvNumReports) = plantDesc(i) & " Shipping Report "
				gaReportsPath(gvNumReports) = itemFiles.Path
				gaReportsDateLastModified(gvNumReports) = itemFiles.DateLastModified				
				gaReportsSize(gvNumReports) = itemFiles.Size
			End If
end If

<asp:Content ID="Content3" ContentPlaceHolderID="PageContent" Runat="Server">
10 Years
Discussion Span
Last Post by peter_budo
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.