dynamic linkbutton ID's

Guest

I am trying to add a section to my form which allows users to upload a
file to sql server and come back with the updated list of uploaded
docs. They can do this as many times(up to 100) as they want until all
the docs they want uploaded have been. Each time a doc is uploaded,
the list comes back with a dynamic linkbutton which is supposed to
remove the file if clicked. The linkbutton is created and the event is
assigned but something odd happens each time i click the remove button.
As I upload the files, when I hover over the linkbuttons created I can
see the command in the bottom left corner of my browser saying
'javascript__doPostBack('_ctl1',''). For each additional linkbutton,
the number after ctl increases by 1. However when I click the remove
linkbutton and the controls are re-created, the numbering sequence
starts at 3 or 4 or some higher number depending on how many
linkbuttons are there. Now when I click on them, they do a postback
event which seems to do nothing except reset the numbering sequence
properly. If i click the control a second time it removes the file but
again screws up the numbering sequence of the remianing control names.
I now have to click twice to get it to remove the file correctly.

I am writing in VB

I wanted to avoid entering the code here if at all possible. If you
think it will help clarify, let me know and I'll do my best to post it.
Thanks for your help.

Share This Page

Welcome to The Coding Forums!

Welcome to the Coding Forums, the place to chat about anything related to programming and coding languages.

Please join our friendly community by clicking the button below - it only takes a few seconds and is totally free. You'll be able to ask questions about coding or chat with the community and help others.
Sign up now!