Display Image using file path stored in database in ASP.Net DataList using C# and VB.Net

Last Reply one year ago By pandeyism

Posted one year ago

Hi,

I have a table Images stored in a database. It contains: Id,Name,Date,Price and an image control(Ajax File Upload).

How can I generate dynamically a thumbnail with the data from db? So, to display on a Web form, the image and below it the name,date,price.

I develop in Visual Studio 2017, C#.

<div class="row" style="padding-top: 50px">
    <asp:Repeater ID="rptrWishlist" runat="server">
        <ItemTemplate>
            <div class="col-sm-3 col-md-3">
                <div class="thumbnail border=rounded-pill align-text-bottom" style="background-color: aliceblue">
                    <img src="Wishlist//flori_Dia.jpg" />
                    <div class="caption">
                        <div class="probrand">
                            Test</div>
                        <div class="proName">
                            Test</div>
                        <div class="proPrice">
                            321</div>
                    </div>
                </div>
                </a>
            </div>
        </ItemTemplate>
    </asp:Repeater>
</div>        

I can not upload an image, so I share the code I tried. This is a hardcoded example. The classes: probrand,proName, proPrice are in CSS souce.

 <style type="text/css">
        .proPrice
        {
            font-size: 14px;
            line-height: 17px;
            font-family: sans-serif;
            font-weight: 600;
        }
        .proName
        {
            font-size: 13px;
            line-height: 17px;
            font-family: sans-serif;
        }
    </style>

Like in this case, I want to display my data from database.

This question does not have replies that have been liked.