Repeater Problem

I want to set a unique id for each item in a repeater like this:

<asp:repeater id=__theTabStrip runat="server" DataSource='<%#
DataBinder.Eval(Container,"TabText") %>'>
<ItemTemplate>
<asp:Button Runat="server" id="<%# Container.DataItem %>" BackColor="<%#
SetTabBackColor(Container) %>" />
</ItemTemplate>
</asp:repeater>

However, the id="<%# Container.DataItem %>" generates an error:'<%#Container.DataItem %>' is not a valid identifier.

View Replies


ADVERTISEMENT

.NET Repeater

I've got a repeater which is pulling items from a database. Some items have a link and some have null filled in for the link column. I was wondering if there is an easy way to format those with links to have an <a href> tag around them and those that have a null link not to be formatted with the surrounding <a> tags. Is there a better way than to just do an if...else clause?

edit: also is there someway I can tell the repeater how often to render the seperatortemplate (i.e., print a horizonal rule every three repeats)?

View Replies View Related

Repeater

I have used repeater before, what I want to use it for is, I get a list of categories, and I want to display them in a table, 3 categories per table row, the problem is I don't know how to get it to start a new row afer 3rd element is displayed.

View Replies View Related

Number In A Repeater

I have a repeater that pulls back informtion from a MySQL database. I was wondering how could I put a counter that increments as each row is returned and displays it in the repeater. For example where it says Day:, I want to make that Day: 1, Day: 2 etc as each row is returned.

The Day: 1++ is just a demonstration of what i want incremented.

<asp:Repeater ID="RepeaterUserReportSummary" runat="server">
<ItemTemplate>
<table style="width: 990px">
<tr>
<td style="width: 185px;height: 10px;"><b>Day: 1++ </b></td>
<td style="width: 35px;height: 10px;"><b>Total:</b><%# Eval("TotalReport")%>cal</td>
</tr>
</table>
</ItemTemplate>
</asp:Repeater>

View Replies View Related

Checkbox In Repeater

I use a Checkbox in a Repeater, how can I know which Checkbox have changed in OnCheckedChanged?

I have tried to set id then checkbox is binding data, but it will not work.

View Replies View Related

CheckBox Inside A Repeater

I'm still learning .Net and have an ASP.Net app that I'm working on. On this particular page, I need to put a bunch of checkboxes on the side of the page, and the text for each is derived from the database. So I can't just hardcode the checkboxes. I'll have any number of them, and possibly even 0.

I am told that you use a Repeater control for this, but beyond that, am not sure what to do. Can someone show me?

View Replies View Related

Presenting Database Results In A Repeater Control

I am using a repeater control to display the results of a database query. The problem is when outputing the results of a multiline nvarchar field.

I generally try put it in a <pre> tag and try to enforce the table width. However this doesn't help and the table width when viewing the page is the width of the page, and not the specified width. Code:

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved