---
title: "How to access dynamically created items in a repeater?"  
description: "How to access dynamically created items in a repeater?"  
author: "Manoj Bhatt"  
published: 2014-09-03  
updated: 2014-09-03  
canonical: https://www.mindstick.com/forum/2244/how-to-access-dynamically-created-items-in-a-repeater  
category: "asp.net"  
tags: ["asp.net"]  
reading_time: 1 minute  

---

# How to access dynamically created items in a repeater?

I have a [repeater](https://www.mindstick.com/blog/197/asp-dot-net-repeater-control):

<[asp](https://www.mindstick.com/articles/751/introduction-to-asp-dot-net-mvc):repeater id="someID" runat="[server](https://www.mindstick.com/articles/43769/what-is-serverless-architecture-is-it-worth-switching-over)">

<[ItemTemplate](https://www.mindstick.com/forum/2057/access-textbox-in-itemtemplate)>

<asp:hyperlink id=<%# [Eval](https://www.mindstick.com/forum/2167/inline-coding-one-more-eval-merge)("ID")%> runat="server"></asp:hyperlink>

</ItemTemplate>

</asp:repeater>

I need to get [reference](https://www.mindstick.com/forum/774/reference-what-does-this-error-mean-in-php) to each hyperlink and [access](https://www.mindstick.com/articles/12994/how-foreigners-can-access-blocked-websites-in-china) to the [attributes](https://www.mindstick.com/articles/13105/2-attributes-that-make-your-odoo-ecommerce-theme-productive-and-engaging) of it.

On ItemDataBound, how do I go ahead and access a hyperlink whose ID is just being set? If I had a fixed ID for the hyperlink, that wouldn't be a problem. But since the I need the ID to also be assigned dynamically, I kinda got lost in finding the way.

## Replies

### Reply by Sumit Kesarwani

Hi Manoj,

```
private void rptMyTest_ItemDataBound(object sender,RepeaterItemEventArgs e)    {        if(e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType ==ListItemType.Item)        {            Control control = e.Item.FindControl("ID_OF_YOUR_CONTROL") as Control;            if(control != null)            {                var dataItem = e.Item.DataItem as MYITEMTYPE;                if(DateTime.Now > dataItem.DateYouNeedToCheck)                   
control.ToolTip = "from the past";              //ALL
THE MAGIC HAPPENS HERE            }        }    }
```


---

Original Source: https://www.mindstick.com/forum/2244/how-to-access-dynamically-created-items-in-a-repeater

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
