473,385 Members | 2,014 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,385 software developers and data experts.

Data not displayed in Repeater

Kim
I created a Repeater (rp1) that is bound to a Datatable, t1. The DataSource
and Datamember properties of rp1 was specified in the properties window as
"ds" and "t1" respectively.

The following code was also included in the HTML view of the form. However,
only the HeaderTemplate rendered in the browser.

<asp:Repeater id="rp1" runat="server">
<HeaderTemplate>
<Table><tr>
<td>Song Name</td>
<td>Artist</td>
<td>Genre</td>
</tr></Table>
</HeaderTemplate>
<ItemTemplate>
<Table><tr>
<td><%# DataBinder.Eval(Container, "DataItem.Song Name") %>
<%# DataBinder.Eval(Container, "DataItem.Artist") %>
<%# DataBinder.Eval(Container, "DataItem.Genre")>
</td>
</tr></Table>
</ItemTemplate>
</asp>
Dec 1 '05 #1
2 1269
2 observations:
1) The markup below is not well-formed. You have there an ending </asp>
instead of </asp:Repeater>,
2) The repeater will render the HeaderTemplate if the datatable is empty
(i.e. no records were retrieved by the query). Use the debugger to step
through the code and verify that you data query retrieved records.
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Kim" wrote:
I created a Repeater (rp1) that is bound to a Datatable, t1. The DataSource
and Datamember properties of rp1 was specified in the properties window as
"ds" and "t1" respectively.

The following code was also included in the HTML view of the form. However,
only the HeaderTemplate rendered in the browser.

<asp:Repeater id="rp1" runat="server">
<HeaderTemplate>
<Table><tr>
<td>Song Name</td>
<td>Artist</td>
<td>Genre</td>
</tr></Table>
</HeaderTemplate>
<ItemTemplate>
<Table><tr>
<td><%# DataBinder.Eval(Container, "DataItem.Song Name") %>
<%# DataBinder.Eval(Container, "DataItem.Artist") %>
<%# DataBinder.Eval(Container, "DataItem.Genre")>
</td>
</tr></Table>
</ItemTemplate>
</asp>

Dec 1 '05 #2
Kim
There are data within the DataTable and I placed the breakpoint on the 1st
statement at <%# DataBind.Eval(Container, "DatatItem.SongName") %>.

The JScript code was stepped through and the data are still not displayed.
Don't know what's wrong.

"Phillip Williams" wrote:
2 observations:
1) The markup below is not well-formed. You have there an ending </asp>
instead of </asp:Repeater>,
2) The repeater will render the HeaderTemplate if the datatable is empty
(i.e. no records were retrieved by the query). Use the debugger to step
through the code and verify that you data query retrieved records.
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Kim" wrote:
I created a Repeater (rp1) that is bound to a Datatable, t1. The DataSource
and Datamember properties of rp1 was specified in the properties window as
"ds" and "t1" respectively.

The following code was also included in the HTML view of the form. However,
only the HeaderTemplate rendered in the browser.

<asp:Repeater id="rp1" runat="server">
<HeaderTemplate>
<Table><tr>
<td>Song Name</td>
<td>Artist</td>
<td>Genre</td>
</tr></Table>
</HeaderTemplate>
<ItemTemplate>
<Table><tr>
<td><%# DataBinder.Eval(Container, "DataItem.Song Name") %>
<%# DataBinder.Eval(Container, "DataItem.Artist") %>
<%# DataBinder.Eval(Container, "DataItem.Genre")>
</td>
</tr></Table>
</ItemTemplate>
</asp>

Dec 6 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: E Stafford | last post by:
I want to have more control over the layout of displayed data in my windows form instead of using a datagrid. I'd like to use a DataReader but I can use a DataSet if need be. In asp.net I can...
0
by: hsr | last post by:
I'm trying to find a way to only display a fixed amount of characters from one field in a data repeater. The field that is read into the dataset is much larger, but I only want to display say the...
13
by: Paul | last post by:
I have developed in ASP in the past and am now getting into ASP.Net and have hit a road block. I've been reading tutorias and documents and am still having problems. I have the following code...
4
by: Alan Silver | last post by:
Hello, I'm trying to use an ArrayList to do data binding, but am getting an error I don't understand. I posted this in another thread, but that was all confused with various other problems,...
1
by: Kim | last post by:
How can I display "No data found" in the repeater if there are no records found after selecting an item from a dropdown list. Another question is: Can repeater perform paging as in datagrid if...
2
by: John Kotuby | last post by:
Hi all, Thanks in advance for any suggestions... I am using a repeater to display the contents of a DataTable which is bound to it. All the rows in the table are being displayed. In the...
1
by: nina297 | last post by:
Hello, I'm a newbie to .NET. Could someone please assist me. I am pulling topics, questions and answers from a database. I've set all of this code in the code behind page which works. I have...
3
by: Emma Middlebrook | last post by:
Hi there, I've been trying to implement a repeater control in an ASP.NET 2 page but I can't seem to get the layout exactly how I want and I'm not sure if it's something that I am doing wrong or...
0
by: Nathan Sokalski | last post by:
I am attempting to get the data that was bound to an item in a Repeater control for use in the ItemDataBound event. Here is the code I am using to attempt to retrieve the data: ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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:
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...

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.