asp.net mvc - Kendo MVC multiple uploaders -


i'm using kendo controls mvc. have basic uploader working, need create them dynamically , handle code on end. here's simple example that's working

<input name="attachments" type="file" id="attachments" /> <script type="text/javascript">     $(document).ready(function () {         $("#attachments").kendoupload({             async: {                 saveurl: '@url.action("save", "appconfig")',                 autoupload: true             }         }); }); </script> [httppost]     public actionresult save(ienumerable<httppostedfilebase> attachments)     {          if (saveuploadedfile(attachments, "background"))         {             return content("");         }         else         {             return content("error");         }      } 

however, need create ids dynamically , handle on backend. how i'm making file uploaders

@foreach (var item in model) {     string fid = string.format("{0}{1}", @item.fieldtype, @item.appconfigid.tostring());                 <input name="@fid" id="@fid" type="file" />                 <script type="text/javascript">                     $(document).ready(function () {                         $("#@fid").kendoupload({                         async: {                             saveurl: '@url.action("save", "appconfig")',                             autoupload: true                         }                     });                 });                 </script>  } 

now httppostedfilebase argument has match id of html element, have no idea how modify code behind, can take in multiple uploaders. ideas?

why don't use multiple functionality of uploader? enabled default.


Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

node.js - StackOverflow API not returning JSON -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -