Repater Control

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

Guest

I want to use a repeater to display a button for every item in the cache.
Each button should have the key of the cache object as its Text property and
it should remove that particular object from the cache.
So if I have two objects in the cache with keys key1, key2, respectively,
the buttons should be labeled and named so. On click of the button key1, the
following should occur:

Cache.Remove(key1);

Can anyone help?

Hector
 
Hi,

If you were asking about the Repeater web control
(System.Web.UI.WebControls.Repeater class), then a more appropriate group is
microsoft.public.dotnet.framework.aspnet.

Anyway, bind the CommandName property of the button to the key in the
datasource. Then attach to the repeater's ItemCommand event. You will be
able to find out which button was clicked if you look up the CommandName
property of the second parameter passed to the handler.

Greetings
Martin Dechev
ASP.NET MVP
 
Back
Top