ASP. net mvc uses jQuery for refreshing uploads

Source: Internet
Author: User

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:


 

 

 

Related Article

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.