Link to home
Start Free TrialLog in
Avatar of VBdotnet2005
VBdotnet2005Flag for United States of America

asked on

Object reference not set to an instance of an object.

In button click event, I got this error. I am not sure why.
Object reference not set to an instance of an object.


  Dim filename As String
   
  filename = Me.FileUpload1.PostedFile.FileName
code.txt
Avatar of Ioannis Paraskevopoulos
Ioannis Paraskevopoulos
Flag of Greece image

Hi,

Try the following code:
        filename = CType(Page.FindControl("FileUpload1"), FileUpload).PostedFile.FileName

Open in new window


Giannis
ASKER CERTIFIED SOLUTION
Avatar of jitendra patil
jitendra patil
Flag of India 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