你的位置:首页 > ASP.net教程

[ASP.net教程]MVC 為頁面的list資料重新命名


function ReBookFileName() {
              
                $("#div_sortable").find("li[name='BookFileFileImgInfo']").each(function (i, v) {
                    $(v).find("input[name='BookFileFileName']").attr("name", "BookFileList[" + i + "].FileName");
                    //alert($(v).find("input[name='BookFileFileNo']").val())
                    $(v).find("input[name='BookFileFileNo']").val(i + 1);
                    //alert($(v).find("input[name='BookFileFileNo']").val())
                    $(v).find("input[name='BookFileFileNo']").attr("name", "BookFileList[" + i + "].FileNo");
                    $(v).find("input[name='BookFileFileExtension']").attr("name", "BookFileList[" + i + "].FileExtension");
                    $(v).find("input[name='BookFileFileSize']").attr("name", "BookFileList[" + i + "].FileSize");
                    $(v).find("input[name='BookFileFileDimension']").attr("name", "BookFileList[" + i + "].FileDimension");
                    $(v).find("input[name='BookFileNewFileName']").attr("name", "BookFileList[" + i + "].NewFileName");
                    $(v).find("input[name='BookFilePageNoCounte']").attr("name", "BookFileList[" + i + "].PageNoCount");
                    $(v).find("input[name='BookFileUploadFileNo']").attr("name", "BookFileList[" + i + "].UploadFileNo");
                })
            }