Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Displaying images from 366 rows
Message
From
10/03/2017 04:42:19
 
General information
Forum:
ASP.NET
Category:
Client-side development
Environment versions
Environment:
C# 5.0
OS:
Windows 10
Database:
MS SQL Server
Miscellaneous
Thread ID:
01648886
Message ID:
01648892
Views:
47
Likes (2)
>Hi everybody,
>
>I have a table with 366 rows and 4 picture columns in varbinary(max) along with the name of the file (so 4 columns with picture + 4 columns with file names).
>
>I need to display all these pictures in the html table.
>
>My question is - after I retrieved my data in binary format for all the rows, what do I need to do to display that data? Do I need to create all these files on the fly?
>
>Thanks in advance.


By 'create all these files on the fly' do you mean to write them out as disk files on the server so that they can be accessed using standard image tags ?
If so I don't see much point - you may as well store them as files in the first place......

I guess you have two options:
(a) embed the image data in the page (as base64) using razor
(b) serve up the image data from a web api url.

For (a) see : https://devio.wordpress.com/2011/01/13/embedding-images-in-html-using-c/

For (b) see the 'Retrieving Image Files' part of http://www.codeguru.com/csharp/.net/returning-images-from-asp.net-web-api.htm.
If you're using angular you could maybe use ng-repeat to make the calls for each row with the right parameters ?

But since you have almost 1500 images on one page I doubt if either will make for a very good user experience....
Maybe rethink the approach so that some content is only loaded 'on demand' ?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform