C#_jquery No refresh Upload

Source: Internet
Author: User

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:


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.