Last night, a user downloaded a small jQuery upload without refreshing. He tried to move the file to the ASP. net mvc application, and the upload was ineffective. Insus. NET uses the Teamviewer Remote Desktop. If there is a problem with the operation. Some netizens say that the source code is copied one by one. Cannot it be moved to ASP. net mvc applications?
Insus. NET Thought about it. The source code is html + ashx, and it can certainly.
A netizen sends code that can run normally to Insus. NET ......
Key script files: http://download.cnblogs.com/insus/MVC/MyAjaxForm.js
Download and store it in the Scripts directory.
Add a view operation to the Controller:
Under the Handlers directory, create Img. ashx:
In fact, it is also a copy, in the #20 lines of code, modify the directory.
Create a view based on the operations of the controller:
. All others are copies.
Demo:
The tested code is sent to netizens, and there is no problem with testing by netizens. At last, the netizens still need to write the processing program on the controller instead of using ashx.
In fact, ashx is still used in the asp.net mvc application, but the methods are the same no matter where it is written.
The following is to cancel ashx and write it on the controller.
Modify the url value in the View:
Demo again: