tags:

views:

279

answers:

0

I'm using an asp:DataList control to display data in two columns...

<asp:DataList  ID="dlBuildings" Runat="server" CssClass="locationGrid" 
    RepeatLayout="table" RepeatColumns="2" RepeatDirection="Horizontal" EnableViewState="False" OnItemDataBound="dlBuildings_ItemDataBound">
    <ItemTemplate><a 
    href="<%# GetDetailUrl(Eval("building_name").ToString() ) %>"><%# Eval("building_name") %></a><br />Count: <%# ((int)Eval("current_attendance")).ToString("N0") %>
    </ItemTemplate>
</asp:DataList>

This is how the output looks...

<table id="ctl05_ctl01_dlBuildings" class="locationGrid" cellspacing="0" border="0" style="border-collapse:collapse;"> 
    <tr> 
     <td><a 

    href="mobile.aspx?page=11808&building=Bldg+100">Bldg 100</a><br />Count: 0
    </td><td><a 

    href="mobile.aspx?page=11808&building=Bldg+1000">Bldg 1000</a><br />Count: 0
    </td> 
    </tr>
    ...

I need to add an "onclick" attribute to the table cells that are generated, but not sure how get access to them. Any help would be appreciated.