Link to home
Create AccountLog in
Avatar of aliciabutler
aliciabutler

asked on

Styling a datalist control

Does anyone have any examples they could post here of styling a datalist control with CSS please?

Here is my code but I wondered if it was possible to use <ul> and <li> rather than <table> and <td>?

<asp:DataList ID="DataList1" runat="server" DataKeyField="ProductID" 
        DataSourceID="SqlDataSource1" RepeatColumns="4" 
        RepeatDirection="Horizontal" CssClass="list-products">
        
        <ItemTemplate>
        <div>    
           
            <asp:ImageButton ID="ImageButton1" runat="server" 
                
                ImageUrl='<%# Eval("ProductImage", "/images/products/md/{0}") %>' 
                PostBackUrl='<%# Eval("ProductID", "ProductDetail.aspx?ProductID={0}") %>' />
            <p><asp:Label ID="ProductNameLabel" runat="server" 
                Text='<%# Eval("ProductName") %>' /><br class="hidden" /><span><strong><asp:Label ID="ProductPrice_GBLabel" runat="server" 
                Text='<%# Eval("ProductPrice_GB", "{0:C}") %>' /></strong></span></p>
            
         </div>  
        </ItemTemplate>
        
    </asp:DataList>

Open in new window

SOLUTION
Avatar of Kumaraswamy R
Kumaraswamy R
Flag of India image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
ASKER CERTIFIED SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account