Selecting Item in a Repeater list

Selecting Item in a Repeater list

am 14.01.2008 16:44:05 von JesperGJensen

I have a list of 5 streets. I need to list these 5 streets to a user
who must then be able to click a street and select the street.

I had thought of using a Repeater control to liste the 5 streets and
in each ItemTemplate create a LinkButton.
If i do this i create a Selected_Changed method and have all
Linkbuttons link to this one method.
But how do i then differentiate between which of the 5 streets was
clicked?


This is for an address selection page, where the user can select
previous addresses, click an address and prefill textboxes based on
the data.

Is there another way to display a list of objects, select one and
execute code on this object, besides doing a Repeater like approach?

Thanks in advance

Re: Selecting Item in a Repeater list

am 15.01.2008 00:26:45 von Scott Roberts

I would populate the CommandArgument property of each LinkButton, then read
that property in the Selected_Changed event.


"JesperGJensen" wrote in message
news:025689ea-dcf3-4e2c-9a8a-250d8925806b@e32g2000prn.google groups.com...
>I have a list of 5 streets. I need to list these 5 streets to a user
> who must then be able to click a street and select the street.
>
> I had thought of using a Repeater control to liste the 5 streets and
> in each ItemTemplate create a LinkButton.
> If i do this i create a Selected_Changed method and have all
> Linkbuttons link to this one method.
> But how do i then differentiate between which of the 5 streets was
> clicked?
>
>
> This is for an address selection page, where the user can select
> previous addresses, click an address and prefill textboxes based on
> the data.
>
> Is there another way to display a list of objects, select one and
> execute code on this object, besides doing a Repeater like approach?
>
> Thanks in advance
>