开发者

ASP.NET MVC User input in C#

I am having the fol开发者_C百科lowing 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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜