Link to home
Start Free TrialLog in
Avatar of pbtech
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(strPath + fileName)
 
)


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

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Faizan Sarwar
Faizan Sarwar
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Please post the Aspx declarations.