Click here to Skip to main content
15,895,084 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
C#
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="gridcheck.aspx.cs" Inherits="Website.gridcheck" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head  runat="server">
    <title>GridView</title>

</head>
<body>
    <form id="form1"  runat="server">
    <div>
    
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
            DataSourceID="SqlDataSource1" AllowPaging="True" BorderStyle="None" 
            CellSpacing="4" GridLines="None" HorizontalAlign="Center" ShowHeader="False" 
            style="text-align: left">
            <Columns>
                <asp:ImageField DataImageUrlField="img" 
                    DataImageUrlFormatString="~/uploads/{0}" ControlStyle-Height="200px" ControlStyle-Width="200px">

                </asp:ImageField>
            </Columns>
            <EmptyDataRowStyle HorizontalAlign="Center" VerticalAlign="Middle" />
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:RoughConnectionString %>" 
            SelectCommand="SELECT [img] FROM [uploads]"></asp:SqlDataSource>
    
    </div>
    </form>
</body>
</html>
Posted
Comments
ZurdoDev 25-Mar-14 18:56pm    
Add a hyperlink. Where are you stuck?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900