After uploading images and storing their paths in the database, I added a template column for the images to display in my web application. However, the images are currently stacking on top of each other. Here is the code snippet that I am using:
<asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False"
DataKeyNames="id" DataSourceID="SqlDataSource2"
EmptyDataText="There are no data records to display." BorderStyle="None">
<Columns>
<asp:BoundField DataField="id" HeaderText="id" ReadOnly="True"
SortExpression="id" Visible="False" />
<asp:TemplateField ShowHeader="False">
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Text='<%# Eval("img") %>'
Tooltip='<%# Eval("img") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<div style="height:90px; white-space:nowrap; display:inline;">
<img id="photoAlbumPhotos" class="photoAlbumPhotos" runat="server" alt="Image Not Found" src='<%# Eval("img") %>' />
</div>
</ItemTemplate>
<ControlStyle BorderStyle="None" />
<ControlStyle BorderStyle="None" CssClass="test"></ControlStyle>
<HeaderStyle BorderStyle="None" />
<ItemStyle BorderStyle="None" HorizontalAlign="Left" Wrap="False" CssClass="test" />
</asp:TemplateField>
</Columns>
<RowStyle Wrap="False" />
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource2" runat="server"
ConnectionString="<%$ ConnectionStrings:testConnectionString1 %>"
DeleteCommand="DELETE FROM [img] WHERE [id] = @id"
InsertCommand="INSERT INTO [img] ([img]) VALUES (@img)"
ProviderName="<%$ ConnectionStrings:testConnectionString1.ProviderName %>"
SelectCommand="SELECT [id], [img] FROM [img]"
UpdateCommand="UPDATE [img] SET [img] = @img WHERE [id] = @id">
<DeleteParameters>
<asp:Parameter Name="id" Type="Int32" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="img" Type="String" />
</InsertParameters>
<UpdateParameters>
<asp:Parameter Name="img" Type="String" />
<asp:Parameter Name="id" Type="Int32" />
</UpdateParameters>
</asp:SqlDataSource>
I have tried using CSS properties like "float:left", "display:inline", and "inline-block" without success.
For this implementation, I am using ASP.NET 4.0.
Thank you.