uploadify is a jquery upload plug-in, the effect is very good, with progress show, this article is a simple introduction demo, mainly dynamic transfer parameter method, through the formdata to the handler to pass additional form data
Uploadify is a jquery upload plugin, the implementation of the effect is very good, with progress display. Uploadify Official website: http://www.uploadify.com/, the method used in MVC can refer to the use of JQuery uploadify in asp.net MVC3 and asp.net Use uploadify in MVC to implement picture scaling saves. This article is a simple introduction demo, mainly dynamic transfer parameter method: Through the formdata to the handler to pass additional form data: Code as follows: <! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd "> <html xmlns=" http://www.w3.org/1999/xhtml "> <head runat=" Server "> <title></ title> <link href= "uploadify/uploadify.css" type= "Text/css" rel= "Stylesheet"/> <script type= "Text/javascript" src= "Uploadify/jquery-1.7.2.min.js" ></script> <script Type= "Text/javascript" src= "Uploadify/swfobject.js" ></script> <script type= "text/" JavaScript "src=" Uploadify/jquery.uploadify.min.js "></script> <script type=" text/ JavaScript "> $ (function () { &nbsP var taskId = "<%= taskId%>"; var ActivityID = "<%= ActivityID%>"; var userId = "<%= getcurrentloginuser (). ID%>"; $ ("#<%=fileupload1.clientid%>"). Uploadify ( &N Bsp ( ' swf ': ' uploadify/uploadify.swf ', &N Bsp ' uploader ': ' uploadhandler.aspx ', &NBS P ' Auto ': false, ' method ': ' Post ', &NBSP ; ' multi ': true, ' buttontext ': ' Browse ', &NB Sp ' buttonimg ': ' uploadify/browse.jpg ', ,   ' folder ': '. /uploadfile ', ' filedesc ': ' Attachments ', ' Onuploadstart ': function (event, data) {//this is where you send the form//data, but Remembe R to get if from post in the. ashx file, by Contex. request["Gallaryid"] $ ("#<%=fileupload1.clientid %> "). Uploadify (' Settings ', ' FormData ', &N Bsp {' taskId ': taskId, ' ActivityID ': ActivityID, ' userId ': userId, ' Secinfo ': $ ("#<%=ddlsecinfo.clientid%>"). Val ()} //note Hiddengallaryid would//have the Gallaryid which im sending post, make through it are sure in Your page (//i.e.not concealed by a MultiView control e.t.c) ); &NBS P }); }); </script> </head> <body> <form id= "Form1" runat= "Server" > &NBS P <asp:fileupload id= "FileUpload1" runat= "server"/> <asp:dropdownlist id= "Ddlsecinfo" runat= " Server "> <asp:listitem text=" public "value=" 1 "> </asp:ListItem> &NBS P <asp:listitem text= "normal" value= "2" > </asp:ListItem> <asp:listitem text= "Confidential" value= "3" > </asp:ListItem> </asp:DropDownList> <a href= "javascript: $ (' #<%=fileupload1.clientid%> '). Uploadify (' upload ', ' * ') "> upload </a> <a href=" javascript : $ (' #<%=fileupload1.clientid%> '). Uploadify (' Cancel ', ' * ') "> Cancel upload </a> </form> < /body> </html>