canvas教程

Bootstrap Fileinput÷

字号+ 作者:H5之家 来源:H5之家 2018-08-08 08:34 我要评论( )

Bootstrap Fileinput÷

Щbootstrap fileinputЩ÷οд

Ч

1input type='file'


2κεbootstrap fileinputbootstrap fileinput

3bootstrap fileinputУ飨


4bootstrap fileinput




ЧΣЧ

1cshtml

jscss

//bootstrap fileinput bundles.Add(new ScriptBundle("~/Content/bootstrap-fileinput/js").Include( "~/Content/bootstrap-fileinput/js/fileinput.min.js", "~/Content/bootstrap-fileinput/js/fileinput_locale_zh.js")); bundles.Add(new StyleBundle("~/Content/bootstrap-fileinput/css").Include( "~/Content/bootstrap-fileinput/css/fileinput.min.css")); @Scripts.Render("~/Content/bootstrap-fileinput/js") @Styles.Render("~/Content/bootstrap-fileinput/css")

input type='file'

<form> <div tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> <div role="document"> <div> <div> <button type="button" data-dismiss="modal" aria-label="Close"><span aria-hidden="true"></span></button> <h4>Excel</h4> </div> <div> <a href="~/Data/ExcelTemplate/Order.xlsx"></a> <input type="file" multiple /> </div></div> </div> </div> </form>

<input type="file" multiple />

multipleclass=file-loading

2js

$(function () { //0.fileinput var oFileInput = new FileInput(); oFileInput.Init("txt_file", "/api/OrderApi/ImportOrder"); }); //fileinput var FileInput = function () { var oFile = new Object(); //fileinputγ oFile.Init = function(ctrlName, uploadUrl) { var control = $('#' + ctrlName); // control.fileinput({ language: 'zh', // uploadUrl: uploadUrl, // allowedFileExtensions: ['jpg', 'gif', 'png'],// showUpload: true, // showCaption: false,// browseClass: "btn btn-primary", // //dropZoneEnabled: false,// //minImageWidth: 50, //С //minImageHeight: 50,//С //maxImageWidth: 1000,// //maxImageHeight: 1000,// //maxFileSize: 0,//λkb0С //minFileCount: 0, maxFileCount: 10, // enctype: 'multipart/form-data', validateInitialCount:true, previewFileIcon: "<i></i>", msgFilesTooMany: "({n}) {m}", }); // $("#txt_file").on("fileuploaded", function (event, data, previewId, index) { $("#myModal").modal("hide"); var data = data.response.lstOrderImport; if (data == undefined) { toastr.error(''); return; } //1. var oTable = new TableInit(); oTable.Init(data); $("#div_startimport").show(); }); } return oFile; };

1fileinput()洫jsonкЩáЩfileinput.js


Щ

2$("#txt_file").on("fileuploaded", function (event, data, previewId, index) {}洦

3C#

jsfileinput()urlurlC#

[ActionName("ImportOrder")] public object ImportOrder() { var oFile = HttpContext.Current.Request.Files["txt_file"]; var lstOrderImport = new List<DTO_TO_ORDER_IMPORT>(); #region 0. var lstExistOrder = orderManager.Find(); var lstOrderNo = lstExistOrder.Select(x => x.ORDER_NO).ToList(); var lstTmModel = modelManager.Find(); var lstTmMaterial = materialManager.Find(); //var iMax_Import_Index = lstExistOrder.Max(x => x.IMPORT_INDEX); //iMax_Import_Index = iMax_Import_Index == null ? 0 : iMax_Import_Index.Value; #endregion #region 1.StreamWorkbook IWorkbook workbook = null; if (oFile.FileName.EndsWith(".xls")) { workbook = new HSSFWorkbook(oFile.InputStream); } else if(oFile.FileName.EndsWith(".xlsx")) { workbook = new XSSFWorkbook(oFile.InputStream); } if (workbook == null) { return new { }; } //...............excel //orderManager.Add(lstOrder); lstOrderImport = lstOrderImport.OrderBy(x => x.IMPORT_STATU).ToList(); return new { lstOrderImport = lstOrderImport }; }

excelNPOIGDI

4

ImportOrderΡ

bootstrap fileinput÷顣

Bootstrap Fileinput÷

:

 

1.本站遵循行业规范,任何转载的稿件都会明确标注作者和来源;2.本站的原创文章,请转载时务必注明文章作者和来源,不尊重原创的行为我们将追究责任;3.作者投稿可能会经我们编辑修改或补充。

相关文章
  • Bootstrap学习网

    Bootstrap学习网

    2018-01-17 18:07

  • 简单实用的Bootstrap选项卡效果

    简单实用的Bootstrap选项卡效果

    2017-01-01 08:01

  • Bootstrap 字体图标(Glyphicons)

    Bootstrap 字体图标(Glyphicons)

    2016-07-16 18:00

  • Bootstrap 教程

    Bootstrap 教程

    2015-10-14 14:28

网友点评