> Hi,
I have a function in my code-behind (vb.net) that checks if the file
the user is trying to upload already exists on the server. At that
point I'd like to display a pop up saying 'Are you sure you want to
overwrite the existing file?'. If the user clilcks yes, the function
carries on.
How can I do that? How can I display a javascript popup at that point
of the execution and get the value returned by that popup ?
I'm really struggling on this :(
Thank you
You can't (as you found out) just show a popup in the middle of
server-side code.
You will need to remember the file server side, redirect to a "are you
sure" page and either remove the stored copy or overwrite the existing
file based on the reaction there (you might also consider giving a new
name).
Server side copy: either a temporary file (but: you will want to
provide some mechanism to delete old copies - as when you never
received an answer to the "are you sure" page), or a Byte[] in Session
(but: this might be big!)
Hans Kesting