pbtech
asked on
FileUpload error message
I am using visual web developer 2008 express edition and I am trying to configure a file upload. I am also using the AJAX Control Toolkit.
I get this error message:
Compiler Error Message: BC30451: Name 'inputFileUpload' is not declared.
Source Error:
Line 16: If inputFileUpload.HasFile Then
Line 17: fileName = inputFileUpload.FileName
Line 18: inputFileUpload.SaveAs(str Path + fileName)
)
I get this error message:
Compiler Error Message: BC30451: Name 'inputFileUpload' is not declared.
Source Error:
Line 16: If inputFileUpload.HasFile Then
Line 17: fileName = inputFileUpload.FileName
Line 18: inputFileUpload.SaveAs(str
)
Partial Class _Default
Inherits System.Web.UI.Page
Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim strPath As String = Server.MapPath("uploads\")
Dim fileName As String
Try
If inputFileUpload.HasFile Then
fileName = inputFileUpload.FileName
inputFileUpload.SaveAs(strPath + fileName)
lblMsg.Text = "File uploaded!"
File Name:" & fileName
Else
lblMsg.Text = "You did not upload anything!"
End If
Catch ex As Exception
lblMsg.Text = ex.ToString
End Try
End Sub
End Sub
End Class
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Please post the Aspx declarations.