现在项目的功能需要,会通过改变一个下拉框的值生成n个上传按钮,点击上传的时候需要传一个id到后台,上传成功后需要通过id修改一下数据库,然后返回图片名称,在相应的img中显示(用jquery提交,无刷新),哪位做过或知道跟这个需求差不多的dome传一下,或者实现方式也行,急用!!!!

解决方案 »

  1.   


    Plupload jquery 批量上传插件Uploadify<body> 
        <form id="form1" runat="server"> 
        <div> 
        <table style="width: 343px"> 
                <tr> 
                    <td style="width: 100px"> 
                        多文件上传</td> 
                    <td style="width: 100px"> 
                    </td> 
                </tr> 
                <tr> 
                    <td style="width: 100px"> 
                        <asp:FileUpload ID="FileUpload1" runat="server" Width="475px" /> 
                        </td> 
                    <td style="width: 100px"> 
                        </td> 
                </tr> 
                <tr> 
                    <td style="width: 100px"> 
                        <asp:FileUpload ID="FileUpload2" runat="server" Width="475px" /></td> 
                    <td style="width: 100px"> 
                    </td> 
                </tr> 
                <tr> 
                    <td style="width: 100px"> 
                        <asp:FileUpload ID="FileUpload3" runat="server" Width="475px" /></td> 
                    <td style="width: 100px"> 
                    </td> 
                </tr> 
                <tr> 
                    <td style="width: 100px"> 
                        <asp:Button ID="bt_upload" runat="server" OnClick="bt_upload_Click" Text="一起上传" /> 
                        <asp:Label ID="lb_info" runat="server" ForeColor="Red" Width="448px"></asp:Label></td> 
                    <td style="width: 100px"> 
                    </td> 
                </tr> 
            </table> 
        </div> 
        </form> 
    </body>
    using System; 
    using System.Data; 
    using System.Configuration; 
    using System.Web; 
    using System.Web.Security; 
    using System.Web.UI; 
    using System.Web.UI.WebControls; 
    using System.Web.UI.WebControls.WebParts; 
    using System.Web.UI.HtmlControls; public partial class _Default : System.Web.UI.Page  

        protected void Page_Load(object sender, EventArgs e) 
        {     } 
        protected void bt_upload_Click(object sender, EventArgs e) 
        { 
            if (FileUpload1.PostedFile.FileName == "" && FileUpload2.PostedFile.FileName == "" && FileUpload3.PostedFile.FileName == "") 
            { 
                this.lb_info.Text = "请选择文件!"; 
            } 
            else 
            { 
                HttpFileCollection myfiles = Request.Files; 
                for (int i = 0; i < myfiles.Count; i++) 
                { 
                    HttpPostedFile mypost = myfiles[i]; 
                    try 
                    { 
                        if (mypost.ContentLength > 0) 
                        { 
                            string filepath = mypost.FileName;//C:\Documents and Settings\Administrator\My Documents\My Pictures\20022775_m.jpg 
                            string filename = filepath.Substring(filepath.LastIndexOf("\\") + 1);//20022775_m.jpg 
                            string serverpath = Server.MapPath("~/images/") + filename;//C:\Inetpub\wwwroot\WebSite2\images\20022775_m.jpg 
                            mypost.SaveAs(serverpath); 
                            this.lb_info.Text = "上传成功!"; 
                        } 
                    } 
                    catch (Exception ex) 
                    { 
                        this.lb_info.Text = "上传发生错误!原因:" + ex.Message.ToString(); 
                    } 
                } 
            } 
        } 
    }参考
      

  2.   

    百度下,jquery上传的插件,很多的
      

  3.   

    SWFUpload