Need help in accessing a control embedded in a repeater

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am implementing pagination using a repeater bound to an ArrayList. The
ArrayList has Prev, 1, 2, 3.. Next values.
<itemTemplate>
<asp:LinkButton id="lnkPages" value=<%(Dictionary.key)%>
item=<%(Dictionary.value)%/>
<itemTemplate>

I am trying to change style of the LinkButton which is currently active or 1
initially. I am using the ItemBound event to do this. I need help in
accessing the LinkButton in this event.
Thanks in advance.
-qwerty
 
in the ItemBound event :

if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType ==
ListItemType.AlternatginItem)
LinkButton lnkPages = (LinkButton) e.Item.FindControl ("lnkPages");
 
Thanks Vko, it works.

Vko said:
in the ItemBound event :

if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType ==
ListItemType.AlternatginItem)
LinkButton lnkPages = (LinkButton) e.Item.FindControl ("lnkPages");
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top