I'm a client/server and database developer filling in for two web developers that just quit. I have very limited knowledge of web programming but I'm working on a program with aspx web pages and vb code behind. Here is my situation:
- Functionality currently exists in a control in a panel on the aspx page to upload a file after validating the file information.
- The aspx page for this control includes two text boxes for description and file path/name and an Upload button.
- When the user clicks Upload, the vb handler for the button clicked event executes. The current code behind checks for description text, file existence, file size and, if they are valid, uploads the file. If any validation fails, a flag (bUploadValid) is set that allows the upload code to be bypassed and an alert is displayed at the end indicating either the upload outcome or a validation error.
- I already determine the file size in the code behind to ensure it is within the maximum but the separation of client and server side does not allow me to suspend the code behind processing to get user confirmation and resume code behind processing.
- My intended solution is to put the code that uploads the file into a separate function and add another flag variable (bConfirmUpload) to the Upload clicked handler to indicate whether user confirmation is required for the upload.
- If the upload is valid and does not require confirmation, the handler will call the function to upload the file.
- If the upload requires confirmation, I need to display the confirm window and, if the user chooses Yes, call the function to upload the file. If the user chooses No, no additional processing is needed.