?
Solved

Datalist question

Posted on 2006-12-01
7
Medium Priority
?
420 Views
Last Modified: 2010-04-16
I am working with the following datalist and it's giving me a problem.  


    <asp:Datalist ID="dlBB" align="center" Width="95%" OnItemCreated="DataList_ItemCreated" runat="server">
        <HeaderTemplate>
            <table class="bordered" cellpadding="2" cellspacing="0" width="100%">
            <tr class="header_row">
                <th colspan="3" class="h_12">Blackberry</th>
            </tr>
            <tr class="subheader_row">
                <th class="b_9" width="250">Device Count</th>
                <th class="b_9" colspan="2">Hierarchy</th>
            </tr>
        </HeaderTemplate>
       
        <ItemTemplate>
            <tr onmouseover="style.backgroundColor='#FFFFCC'" onmouseout="style.backgroundColor=''">
                <td class="r_10" width="100"><%# Container.Dataitem("DeviceCount")%>&nbsp;</td>
                <td class="r_10" colspan="2"><%#CommonFunctions.CommonFunctions.GetHierarchy(Container.DataItem("Hierarchy"))%>&nbsp;</td>
            </tr>
        </ItemTemplate>
       
       <FooterTemplate>
            <tr>
              <td>
                  <asp:Label ID="lblBBTotal" CssClass="b_10" runat="server" />
              </td>
              <td colspan="2" align="right">
                <a class="reglink" href="HierarchyReport.aspx?vendor=<%=lblVendor.text%>&action=HierarchyReportBB" target="_blank">Download Excel Report</a>
              </td>
            </tr>
            </table>
        </FooterTemplate>
    </asp:Datalist>


For whatever reason, it's putting an extra <td> tag around the <itemtemplate>, like such:
<tr><td>
            --contents of the item template
                <td class="r_10" width="100">1&nbsp;</td>
                <td class="r_10" colspan="2">F - TS & F&nbsp;</td>
 </td></tr>

It's screwing up my css and driving me nuts.  Any thoughts?

Thanks,

N
0
Comment
Question by:stretch73
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 4

Expert Comment

by:hclgroup
ID: 18056034
In what way is it messing with your CSS?
0
 

Author Comment

by:stretch73
ID: 18056074
It's making the border double as thick as it is supposed to be
0
 
LVL 2

Expert Comment

by:AmNoGeek
ID: 18056715
Is the cellpadding="2" causing it?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:stretch73
ID: 18096604
Changing the cellpadding didn't change anything.  I think it's something to do with the way the Datalist generates HTML.  I changed one of the datalists to a repeater control and it worked fine.
0
 

Author Comment

by:stretch73
ID: 18103292
In the interest of time, I just changed all of the datalists to repeater controls which seems to have fixed the problem.  Apparently it renders HTML differently which is why I was getting extra tags.
0
 

Accepted Solution

by:
RomMod earned 0 total points
ID: 18135868
Question closed - 250 points refunded.

Best regards,
RomMod
Experts Exchange
Community Support Moderator
0

Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
Simple Linear Regression

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question