Last post Mar 19, 2008 12:41 PM by gator2683
Mar 18, 2008 02:59 PM|gator2683|LINK
Hello, I am looking for a little direction with a custom control. I will try and include only the relevant portions so I can highlight the area I am having difficulties with
I am attempting to make a composite control called FileList that can be used to manage the files in a folder (think email attachments)
Filelist has several child controls, the relevant ones are:_file as FileUpload,_button as Button
The intent is to catch the _button.click event and call _file.saveas to some directory
inside FileList.vb, I created a sub to handle _button.click, and this fires on the click normally, but _file.hasfiles is false. I notice that createchildcontrols is creating a new _file each postback before the click event is handled
I have found some similar posts, and an example of how to implement ipostbackdatahandler, but I am still unclear about how to put it all together. The example seems to be sticking a string in viewstate and reading it from postCollection(postDataKey) blindly.
How would I do something equivalent with a fileUpload's data? Do I need to stick my _file into the viewstate?
I suspect I am missing something and there is an easier way to do this. Thanks,
Mar 19, 2008 12:41 PM|gator2683|LINK
Just following up...I got it working. It was in an update panel which does not allow file uploads :/ Hopefully this lesson in frustration helps someone else