D
David C
I am getting the error below and I cannot figure out what to do to fix it.
I only have 1 Page_Load event in my code behind page and the error refers to
that line where Page_Load subroutine starts. Below the error is my
Page_Load code. Can anyone help? Thanks.
David
An unhandled exception occurred:
Message: c:\inetpub\wwwroot\BodyShop\JobImages.aspx.vb(6): error BC30269:
'Protected Sub Page_Load(sender As Object, e As System.EventArgs)' has
multiple definitions with identical signatures.
Stack Trace:
at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath
virtualPath)
at
System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath
virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean
allowBuildInPrecompile)
at
System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext
context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp,
Boolean allowBuildInPrecompile)
at
System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath
virtualPath, HttpContext context, Boolean allowCrossApp, Boolean noAssert)
at
System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath
virtualPath, Type requiredBaseType, HttpContext context, Boolean
allowCrossApp, Boolean noAssert)
at System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context,
String requestType, VirtualPath virtualPath, String physicalPath)
at
System.Web.UI.PageHandlerFactory.System.Web.IHttpHandlerFactory2.GetHandler(HttpContext
context, String requestType, VirtualPath virtualPath, String physicalPath)
at System.Web.HttpApplication.MapHttpHandler(HttpContext context, String
requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig)
at
System.Web.HttpApplication.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
completedSynchronously)
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
If Not Request.QueryString("ro") Is Nothing Then
Dim strFolderName As String = ""
Dim strRepairOrderID As String =
Request.QueryString("ro").ToString
Dim strurl As String = "OpenOrders.aspx?ro=" & strRepairOrderID
Dim bolLines As Boolean = False
If Not Request.QueryString("lines") Is Nothing Then
strurl &= "&lines=" & Request.QueryString("lines").ToString
If Request.QueryString("lines").ToString = "yes" Then
bolLines = True
End If
BtnReturn.PostBackUrl = strurl
End If
Dim strRecordID As String = ""
Dim conData As SqlConnection = New
SqlConnection(ConfigurationManager.ConnectionStrings("MgmtConnectionString").ConnectionString)
conData.Open()
Dim strSQL As String = ""
strSQL = "SELECT Customer, Vehicle, InsuranceID, RepairOrderID,
RecordID, FolderName" & _
" FROM dbo.vw_RepairOrdersOpen" & _
" WHERE RepairOrderID = " & strRepairOrderID
Dim cmdSelect As SqlCommand = New SqlCommand(strSQL, conData)
Dim dtr As SqlDataReader = cmdSelect.ExecuteReader()
If dtr.HasRows Then
While dtr.Read()
strFolderName = dtr("FolderName").ToString
strRecordID = dtr("RecordID").ToString
Dim lbl As Label =
Page.Master.FindControl("LblCustomer")
lbl.Text = dtr("Customer")
lbl = Page.Master.FindControl("LblVehicle")
lbl.Text = dtr("Vehicle")
Dim tx As TextBox =
Page.Master.FindControl("txtRecordID")
tx.Text = strRecordID
tx = Page.Master.FindControl("txtRepairOrderID")
tx.Text = dtr("RepairOrderID").ToString
Dim Lbtn As LinkButton
Lbtn = Page.Master.FindControl("LBtnReports")
If bolLines = True Then
Lbtn.PostBackUrl =
"reports/ReportSelection.aspx?ro=" & strRepairOrderID & "&lines=yes"
Else
Lbtn.PostBackUrl =
"reports/ReportSelection.aspx?ro=" & strRepairOrderID & "&lines=no"
End If
End While
End If
'On the first page visit, populate the photos
If Not Page.IsPostBack Then
'First page visit
txtMsg.Text = strFolderName
If strFolderName <> "" Then
'Run function to replace any illegal folder characters
If Right(strFolderName, 1) = "\" Then
strFolderName = Left(strFolderName,
Len(strFolderName) - 1)
End If
Dim strFolderPath As String = "~/Photos/" &
strFolderName
Dim strFolderPathPhy = Server.MapPath(strFolderPath)
If
My.Computer.FileSystem.DirectoryExists(strFolderPathPhy) = False Then
Dim virtualFolderPath As String = strFolderPath &
"/RO" & strRepairOrderID
'Get information about the files in the specified
folder
Dim strPhysicalPath As String =
Server.MapPath(virtualFolderPath).ToString
Dim folder As New DirectoryInfo(strPhysicalPath)
If
My.Computer.FileSystem.DirectoryExists(strPhysicalPath) Then
'Dim fileList As FileInfo() =
folder.GetFiles("*.tif")
Dim fileList As FileInfo() =
folder.GetFiles("Initial*.jpg")
Dim pics As ArrayList = New ArrayList()
Dim s As String
For Each s In
Directory.GetFiles(strPhysicalPath, "*.jpg")
'Get information about the image
pics.Add(s)
'currentImage.Dispose()
Next
PicturesInFolder.DataSource = pics
PicturesInFolder.DataBind()
End If
End If
End If
End If
End If
End Sub
I only have 1 Page_Load event in my code behind page and the error refers to
that line where Page_Load subroutine starts. Below the error is my
Page_Load code. Can anyone help? Thanks.
David
An unhandled exception occurred:
Message: c:\inetpub\wwwroot\BodyShop\JobImages.aspx.vb(6): error BC30269:
'Protected Sub Page_Load(sender As Object, e As System.EventArgs)' has
multiple definitions with identical signatures.
Stack Trace:
at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath
virtualPath)
at
System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath
virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean
allowBuildInPrecompile)
at
System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext
context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp,
Boolean allowBuildInPrecompile)
at
System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath
virtualPath, HttpContext context, Boolean allowCrossApp, Boolean noAssert)
at
System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath
virtualPath, Type requiredBaseType, HttpContext context, Boolean
allowCrossApp, Boolean noAssert)
at System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context,
String requestType, VirtualPath virtualPath, String physicalPath)
at
System.Web.UI.PageHandlerFactory.System.Web.IHttpHandlerFactory2.GetHandler(HttpContext
context, String requestType, VirtualPath virtualPath, String physicalPath)
at System.Web.HttpApplication.MapHttpHandler(HttpContext context, String
requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig)
at
System.Web.HttpApplication.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
completedSynchronously)
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
If Not Request.QueryString("ro") Is Nothing Then
Dim strFolderName As String = ""
Dim strRepairOrderID As String =
Request.QueryString("ro").ToString
Dim strurl As String = "OpenOrders.aspx?ro=" & strRepairOrderID
Dim bolLines As Boolean = False
If Not Request.QueryString("lines") Is Nothing Then
strurl &= "&lines=" & Request.QueryString("lines").ToString
If Request.QueryString("lines").ToString = "yes" Then
bolLines = True
End If
BtnReturn.PostBackUrl = strurl
End If
Dim strRecordID As String = ""
Dim conData As SqlConnection = New
SqlConnection(ConfigurationManager.ConnectionStrings("MgmtConnectionString").ConnectionString)
conData.Open()
Dim strSQL As String = ""
strSQL = "SELECT Customer, Vehicle, InsuranceID, RepairOrderID,
RecordID, FolderName" & _
" FROM dbo.vw_RepairOrdersOpen" & _
" WHERE RepairOrderID = " & strRepairOrderID
Dim cmdSelect As SqlCommand = New SqlCommand(strSQL, conData)
Dim dtr As SqlDataReader = cmdSelect.ExecuteReader()
If dtr.HasRows Then
While dtr.Read()
strFolderName = dtr("FolderName").ToString
strRecordID = dtr("RecordID").ToString
Dim lbl As Label =
Page.Master.FindControl("LblCustomer")
lbl.Text = dtr("Customer")
lbl = Page.Master.FindControl("LblVehicle")
lbl.Text = dtr("Vehicle")
Dim tx As TextBox =
Page.Master.FindControl("txtRecordID")
tx.Text = strRecordID
tx = Page.Master.FindControl("txtRepairOrderID")
tx.Text = dtr("RepairOrderID").ToString
Dim Lbtn As LinkButton
Lbtn = Page.Master.FindControl("LBtnReports")
If bolLines = True Then
Lbtn.PostBackUrl =
"reports/ReportSelection.aspx?ro=" & strRepairOrderID & "&lines=yes"
Else
Lbtn.PostBackUrl =
"reports/ReportSelection.aspx?ro=" & strRepairOrderID & "&lines=no"
End If
End While
End If
'On the first page visit, populate the photos
If Not Page.IsPostBack Then
'First page visit
txtMsg.Text = strFolderName
If strFolderName <> "" Then
'Run function to replace any illegal folder characters
If Right(strFolderName, 1) = "\" Then
strFolderName = Left(strFolderName,
Len(strFolderName) - 1)
End If
Dim strFolderPath As String = "~/Photos/" &
strFolderName
Dim strFolderPathPhy = Server.MapPath(strFolderPath)
If
My.Computer.FileSystem.DirectoryExists(strFolderPathPhy) = False Then
Dim virtualFolderPath As String = strFolderPath &
"/RO" & strRepairOrderID
'Get information about the files in the specified
folder
Dim strPhysicalPath As String =
Server.MapPath(virtualFolderPath).ToString
Dim folder As New DirectoryInfo(strPhysicalPath)
If
My.Computer.FileSystem.DirectoryExists(strPhysicalPath) Then
'Dim fileList As FileInfo() =
folder.GetFiles("*.tif")
Dim fileList As FileInfo() =
folder.GetFiles("Initial*.jpg")
Dim pics As ArrayList = New ArrayList()
Dim s As String
For Each s In
Directory.GetFiles(strPhysicalPath, "*.jpg")
'Get information about the image
pics.Add(s)
'currentImage.Dispose()
Next
PicturesInFolder.DataSource = pics
PicturesInFolder.DataBind()
End If
End If
End If
End If
End If
End Sub