I'm trying to use htmlinputfile control with id="fileup" in an aspx page. The page has an aspx button with id="Upload" and form tag like this "<Form EncType="multipart/form-data" runat="Server">". This seems to work fine if I have all in one code file. However, if I use the code behind method, I declare the control in the page behind with "Protected WithEvents fileup As HtmlInputFile". The page displays ok in the browser and I can use the browse button to pick a file. However when I click the upload button and run the subroutine for it, I get an error on this line "fileup.postedfile.saveas("new.gif"
". The error is "Object reference not set to an instance of an object". And if I look at "fileup" in a debug watch window it says it is set to 'nothing'.
Don't know what I'm doing wrong. Do I need to declare the control differently????
Oakgrove Computer Grouper
Lansing, MI
Don't know what I'm doing wrong. Do I need to declare the control differently????
Oakgrove Computer Grouper
Lansing, MI