473,407 Members | 2,359 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

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 1724
* "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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Thanh | last post by:
I created an ASP.NET project and dropped a DataList on the web form. I then wrote a simple class to return data: namespace Playing { public class PositionData { private string name; private...
3
by: Stimp | last post by:
I have a datalist that outputs a link to a picture in each ItemTemplate: e.g. <asp:DataList id="DataList1" ...etc> <ItemTemplate> <a href='Pic.aspx?pic=somenumber'>picture</a> </ItemTemplate>...
2
by: IGotYourDotNet | last post by:
Can anyone tell me how to find a table within a datalist? I can find the labels and textboxes in the dl and change the formatting based on the data, but I can't find the table in the DL. Can anyone...
5
by: serge calderara | last post by:
Dear all, Does this datalist control is somehow similar as a datasource for any other control ? I really to catch the use of it, can we assimilate that control as a kind of dataset or...
4
by: Grace | last post by:
I use a datagrid included in a repeater. as following: (.aspx) <asp:repeater id="rp_perform" Runat="server"> <HeaderTemplate> <table border="0" bgcolor="gray" cellspacing="0" cellpadding="0">...
3
by: GD | last post by:
I'm using a DataList and a Repeater (nested in the DataList) to display a list of "Chapters" and "Documents" within the Chapters. <asp:DataList ID="dlChapter" Runat="server" RepeatColumns="2"...
7
by: | last post by:
I'm using ASP.NET 2.0, C#, SQL Server 2005, and databound controls like the DataList and the GridView. Right now I'm using SqlDataSource as part of very quick and dirty site; I'm not looking to...
1
by: lucaslyana | last post by:
I have a datalist with multiple controls in the itemtemplate which can be selected. For example, a button can be clicked to vote on a topic, and upon selection it increments by 1. If I click on...
2
by: Paulo | last post by:
What is DetailsView, FormView, DataList, Repeater components? Any differences? VS 2005 asp.net C#
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.