标签云

微信群

扫码加入我们

WeChat QR Code

I would like to know that On Page refresh I would like to display more than 40+ images which are already existed in my server folder to be displayed in a div control which already exists and add those images to that divAs of now I can display one image using as shown below:Preview.ImageUrl = "~/DownloadImages/" & Session("tempDir").ToString & "/" & filenameI would like to know the better solutions!Here is how the images are generated:<script type="text/javascript">$(function () {$("#<%=uploader.ClientId%>").plupload({runtimes: 'gears,flash,silverlight,browserplus,html5',url: 'Default.aspx',max_file_size: '10mb',max_file_count: 21,chunk_size: '1mb',unique_names: true,rename: true,dragdrop: true,filters: [{ title: "Image files", extensions: "jpg,gif,png" },{ title: "Zip files", extensions: "zip" }],flash_swf_url: 'js/plupload.flash.swf',silverlight_xap_url: 'js/plupload.silverlight.xap'});$('form').submit(function (e) {var uploader = $('#<%=uploader.ClientId%>').plupload('getUploader');if (uploader.files.length > 0) {uploader.bind('StateChanged', function () {if (uploader.files.length === (uploader.total.uploaded + uploader.total.failed)) {$('form')[0].submit();}});uploader.start();}else//alert('You must at least upload one file.');return false;});var uploader = $('#<%=uploader.ClientId%>').plupload('getUploader');uploader.bind('FilesAdded', function (up, files) {var i = up.files.length,maxCountError = false;plupload.each(files, function (file) {setTimeout(function () {up.start();}, 100);if (uploader.settings.max_file_count && i >= uploader.settings.max_file_count) {$.msgBox({title: "Info",content: "Max Files Reached.",type: "info",showButtons: true,opacity: 0.1,autoClose: false});uploader.removeFile(up.files[i - 1]);} else {}});});var uploader = $('#<%=uploader.ClientId%>').plupload('getUploader');uploader.bind('FileUploaded', function (up, file, res) {$('#<%=thumbs.ClientId%>').append("<div id=" + file.id + "><a href='Uploads/" + document.getElementById("<%=currentDirectory.ClientId%>").value + "/" + file.name + "' rel='group1'><img class='clickImage' src='Uploads/" + document.getElementById("<%=currentDirectory.ClientId%>").value + "/" + file.name + "' width='75' height='50' data-full='Uploads/" + document.getElementById("<%=currentDirectory.ClientId%>").value + "/" + file.name + "'/></div>");if (uploader.files.length === (uploader.total.uploaded + uploader.total.failed)) {showStickySuccessToast();}});});function randomString(length) {var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz'.split('');if (!length) {length = Math.floor(Math.random() * chars.length);}var str = '';for (var i = 0; i < length; i++) {str += chars[Math.floor(Math.random() * chars.length)];}return str;}</script>If I know how many Images users can add then it's easy but It's hard to say thats the main issue.


You need to add more details; what you said is confusing: e.g. do you want all images displayed at once, or one at a time (where you'd somehow be switching; how? button click?).

2019年04月19日22分16秒

Hari-Sorry if it's confusing you!I need to add all Images from existing folder and I need to display them.And Not one at a time all at once.

2019年04月19日22分16秒

In that case, the answer that H27studio provided should work for you. Except maybe you could use Panel control instead of the div#existingDiv, if that's easier for you.

2019年04月20日22分16秒

H27studio-Thanks for your reply.When I convert this sample to VB it shows me error at urlsList what do I need to replace that?

2019年04月20日22分16秒

For VB also is:new System.Web.UI.WebControls.Image() With { .ImageUrl = imageURL}

2019年04月19日22分16秒

DotNetter What does the error say?Error messages are not magic incantations.

2019年04月20日22分16秒

Thats one change, and in urlsList you have to create an array or a List(of String) and add inside the Urls of the images. ;-)

2019年04月20日22分16秒

Sorry I have done mistake and now it got working.Thank you so much you have really saved a bunch of time for me :)Cheers

2019年04月20日22分16秒