Questions tagged [repeater]

The Repeater control is used to display a repeated list of items that are bound to the control.

The ASP.NET Repeater is a basic container control that allows you to create custom lists from any data available to the page. It's a handy control, especially since most ASP.NET pages that display data need to repeat the same kinds of data over and over.

2759 questions
10
votes
2 answers

using if with eval("") in asp.net

I am using repeater to display the news on the news section. In my news section i have got 2 labels(title, Description) and one image field. Below is the code which i am using to populate the repeater:
Mr A
  • 5,778
  • 23
  • 76
  • 133
10
votes
2 answers

Anonymous type in Repeater DataBound event

I'm setting the DataSource of an ASP.NET repeater as follows: rptTargets.DataSource = from t in DB.SalesTargets select new { t.Target, t.SalesRep.RepName }; Now, in the repeater's OnDataBound event, how can I retrieve the RepName and Target…
staterium
  • 1,940
  • 2
  • 20
  • 31
10
votes
1 answer

What is the easiest way to put an index to a repeater control in .NET?

I want an ASP:NET WebForms Repeater control to put an index next to each of its output rows automatically. How can I do that? Example: Name 1 John 2 Jack 3 Joe
Barış Velioğlu
  • 5,243
  • 14
  • 54
  • 97
9
votes
1 answer

Adding value to list stored in session and then using as datasource for repeater

I have two repeaters on my page. The first repeater has a LinkButton in it, with a commandname and commandarguement. When the linkbutton is clicked the value of commandarguement is supposed to be stored in a Session containing List. Then I use the…
higgsy
  • 1,961
  • 8
  • 29
  • 45
9
votes
4 answers

Looping through a repeater control to get values of Textbox in asp.net

I am trying to loop through my repeater control and get the textbox values. However, I am getting an error: {"Object reference not set to an instance of an object."} my code is: Dim txtField As TextBox Dim j As Integer = 0 'Confirm…
Frank
  • 1,985
  • 9
  • 35
  • 57
9
votes
4 answers

Python String Concatenation - concatenating '\n'

I am new to Python and need help trying to understand two problems i am getting relating to concatenating strings. I am aware that strings can be added to concatenate each other using + symbol like so. >>> 'a' + 'b' 'ab' However, i just recently…
Abraham
  • 91
  • 1
  • 1
  • 2
9
votes
1 answer

A control with ID could not be found for the trigger in UpdatePanel

I have an update panel that has UpdateMode of Conditional and ChildrenAsTriggers set to false. I only want a few controls to cause an asynchronous postback:
Dismissile
  • 30,816
  • 34
  • 167
  • 253
9
votes
8 answers

How to count the total number of rows in a ACF repeater output

Question: How do you simply count the rows in the output of an ACF repeater field? Goal: to make the output look different with a css class when there's only one row, vs. more than one row. My code: if( have_rows('testimonials')) { $counter =…
Robert
  • 467
  • 1
  • 4
  • 12
9
votes
5 answers

ASP.Net: why is my button's click/command events not binding/firing in a repeater?

Here's the code from the ascx that has the repeater:

A sub-header:

[Some other stuff is here]
travis
  • 33,392
  • 20
  • 68
  • 93
9
votes
3 answers

How to find checked RadioButton inside Repeater Item?

I have a Repeater control on ASPX-page defined like this:
Alexander Prokofyev
  • 32,090
  • 32
  • 91
  • 115
9
votes
4 answers

ASP.NET Repeater ItemDataBound happening AFTER PreRender event?

I have a repeater control on an ASP.NET 2.0 web form. As I understanding it, all of the page's data-bound controls fire their binding events somewhere in between the Page_Load and the Page_PreRender events. However, my repeater's ItemDataBound…
Matias Nino
  • 4,165
  • 13
  • 44
  • 62
8
votes
4 answers

Render empty repeater

When Repeater contains no items it's not get rendered in HTML at all, even HeaderTemplate or FooterTemplate. I need to manipulate it on client-side even if it's empty. Is there any way to always render Repeater in HTML?
Max Al Farakh
  • 4,046
  • 4
  • 27
  • 52
8
votes
2 answers

Equivalent of Eval("field") in ASP.NET Repeater ItemDataBound event?

I want to do the equivalent of Eval("field") in an ASP.NET repeater ItemDataBound Event but am not sure what to cast e.Item.DataItem as. The data source type could vary as this is reusable code in a custom control. So how can I access a field in…
John
  • 139
  • 1
  • 1
  • 6
8
votes
1 answer

wp_query and meta_query for repeater field values

I have a word press site with custom fields. I need to query a repeater field as a table. It looks like that: | param_1 | param_2 | param_2 | param_4 | 20 | 20 | 20 | 20 | 555 | 680 | 56 | …
matisa
  • 412
  • 3
  • 20
8
votes
7 answers

Save and Display Image from DataBase

Not sure if this is close or not. I'm creating an image field within the database table Events using the code public string EvtImage { get; set; } For a start I'm not even sure if it should be a string. I am then trying to add the Image to the…
Stuart
  • 143
  • 1
  • 3
  • 17