Last night, netizens have downloaded a jquery no-refresh upload small feature, he tried to move to the ASP. NET MVC application, the upload is dead or alive. Insus.net use TeamViewer Remote Desktop, operation, indeed there is a problem. Netizen is to say, the source code one by one copy copying. Can't it move the value to the ASP. NET MVC application?
Insus.net thought about it, the source code is HTML+ASHX, it must be able to.
The netizen sends the code which can run normally to insus.net ...
The focus of the script file: http://download.cnblogs.com/insus/MVC/MyAjaxForm.js
Download it and store it in the scripts directory.
Add a view operation to the controller:
Under the Handlers directory, create the IMG.ASHX:
In fact, is also copied, in #20 line code, modify the directory.
Depending on the operation of the controller, create a view:
, modify the path of the ashx. All others are copied.
Demonstrate:
The test good code sent to the Netizen, the Netizen test also has no problem, but finally, the Netizen also has the request, needs not to use the ashx, but the processing procedure, writes on the controller.
In fact, ASHX is still used in ASP. NET-MVC applications, but the method is the same no matter where it is written.
Here is the cancellation of the ASHX, written on the controller.
Modify the value of the URL in the view:
Demo again: