T
tony collier
Help please.
I have a list of items on my page, alongside each of which i have a
DELETE imagebutton. There can be from 0 to 6 items in the list and they
are placed in a table which cannot be dynamically generated, therefore i
have 6 imagebuttons (for DELETE) and 6 labels (for item name) placed in
the table. There is a string array labelText[6] such that i have
label0.Text=labelText[0];
label1.Text=labelText[1];
etc.
and boolean array buttonvisible[6] such that
button0.Visible=buttonVisible[0];
etc.
I would like each imagebutton to call the same function but somehow pass
a parameter to indicate which item should be deleted.
I could then on postback
1) call the function and delete appropriate item from the list -
labelText[button_no_pressed]="";
and
2) make that delete button invisible
buttonVisible[button_no_pressed]=false;
by using the passed parameter(button_no_pressed=0, button_no_pressed=1
etc)
Can I do this by using onCommand , CommandName and CommandArgument which
i don't really understand yet?
I have a list of items on my page, alongside each of which i have a
DELETE imagebutton. There can be from 0 to 6 items in the list and they
are placed in a table which cannot be dynamically generated, therefore i
have 6 imagebuttons (for DELETE) and 6 labels (for item name) placed in
the table. There is a string array labelText[6] such that i have
label0.Text=labelText[0];
label1.Text=labelText[1];
etc.
and boolean array buttonvisible[6] such that
button0.Visible=buttonVisible[0];
etc.
I would like each imagebutton to call the same function but somehow pass
a parameter to indicate which item should be deleted.
I could then on postback
1) call the function and delete appropriate item from the list -
labelText[button_no_pressed]="";
and
2) make that delete button invisible
buttonVisible[button_no_pressed]=false;
by using the passed parameter(button_no_pressed=0, button_no_pressed=1
etc)
Can I do this by using onCommand , CommandName and CommandArgument which
i don't really understand yet?