468,294 Members | 1,794 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,294 developers. It's quick & easy.

First item disappears in datalist and data repeater

When I tried to display data in datalist and repeater, the first data item
always disappears in all datalist and repeaters in my web forms. The code I
use for the html page is:

<TD id="tdDepartment" runat="server"><asp:datalist id="dlstDept"
runat="server" HorizontalAlign="Left" CellPadding="0" Width="100%">
<HeaderTemplate>
<p><b>Department Info</b></p>
</HeaderTemplate>
<ItemTemplate>
<font size="2">&nbsp;&nbsp; <a href='department.aspx?id=<%#
databinder.eval(container.dataitem, "DeptID")%>' class="categoryLink">
<%# databinder.eval(container.dataitem, "DeptName") %>
</a></font>
</ItemTemplate>
</asp:datalist></TD>
And the code I use for the VB page is:

With dlstDept
.DataSource = drDept
.DataBind()
End With

Where drDept is an ODBCDataReader, since I am using MySQL.

(note: This issue only happened in the datalist and repeater of my web
project, everything else (including listbox and dropdown) is fine.)

One thing I am not sure is the, class="categoryLink", part.... Please help!

Any advise are very appreciated. Thank you!
Nov 20 '05 #1
1 1565
* "Simon Cheng" <sc****@goodmans.ca> scripsit:
When I tried to display data in datalist and repeater, the first data item
always disappears in all datalist and repeaters in my web forms. The code I
use for the html page is:

<TD id="tdDepartment" runat="server"><asp:datalist id="dlstDept"
runat="server" HorizontalAlign="Left" CellPadding="0" Width="100%">
<HeaderTemplate>
<p><b>Department Info</b></p>
</HeaderTemplate>
<ItemTemplate>
<font size="2">&nbsp;&nbsp; <a href='department.aspx?id=<%#
databinder.eval(container.dataitem, "DeptID")%>' class="categoryLink">
<%# databinder.eval(container.dataitem, "DeptName") %>
</a></font>
</ItemTemplate>
</asp:datalist></TD>


<news://news.microsoft.com/microsoft.public.dotnet.framework.aspnet>
<news://news.microsoft.com/microsoft.public.dotnet.framework.aspnet.datagridc ontrol>
<news://news.microsoft.com/microsoft.public.dotnet.framework.aspnet.webcontro ls>

--
Herfried K. Wagner
MVP VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Thanh | last post: by
2 posts views Thread by IGotYourDotNet | last post: by
5 posts views Thread by serge calderara | last post: by
3 posts views Thread by GD | last post: by
reply views Thread by NPC403 | last post: by
reply views Thread by Teichintx | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.