I have a FormView control that is setup to use SQLDataSource control for insert/update. However, in this FormView control form, I also have a few FileUpload controls for users to upload their pictures. At the moment, I put the performFileUpload function inside of the FormView1_ItemInserting method. Theh problem with this is that for some reason, the record got inserted twice everytime a user tries to submit his/her information. The PerformFileUpload functio involves uploading the file to the web server folder and then attached the file name to the SqlDataSource.InsertParameters["image1"].DefaultValue so that this field also has the correct file name for displaying back to the users.
The question is, how and/or where do I put the PerformFileUpload function so that the record does not get inserted twice into the database?
Any suggestion is much appreciated.
...
Go to the complete details ...