views:

44

answers:

1

Hello,

I am having the following issue, when a user fills in a form, I make an xml file based on that information and copy a file from one folder to another. (The filename is input by the user).

If the file already exists however, there will have to be a user input on whether to overwrite this file or not. I know I can't use a messagebox and if I do whether to use javascript or jQuery, I'd be adding a page as well. Preferably, I'd like to stay in C# but thats not possible without the messageboxes.

I have looked around google and stackoverflow, and the best I can think off is creating an extra page for this, where if the file exists, the user has to pick one of two options and then go back to moving the file (or not).

I am new to ASP MVC and I was wondering if this was the best way to go about it and what the best way to go is if it isn't.

+1  A: 

Using JQuery you could make an ajax call to a controller to see if the file exists and show the user a dialog asking if they would like to overwrite the file if it exists. I can't see that you'd need a view for this at all.

Simon Hazelton
as far as i can see this is the best solution but going this way was not possible. But the way with an extra view is bad developing. I have removed the user confirmation since the problem could only occur during tests. Next time something like this occurs i will press harder for a java/Jquerry based solution.
Andy