Click event in a datalist to post back datalist properties

  • Thread starter Thread starter Steve Lloyd
  • Start date Start date
S

Steve Lloyd

Hi there,

I have built a data list that contains dropdownlists that are populated
depending on details of the item in the datalist by adding a datasource to
the drop downs as part of the itembound event, which has all worked very
nicely... My problem is that i want to use a click event on a LinkButton
that is part of the datalist item and use the information selected in the
combobox as part of the server side click event.

can anyone point me in the right direction pls.

Thanks for any help.

Steve Lloyd
 
During the page load event, if it is a postback, check for the edititemindex
<> -1. This means that you are in edit mode.
Use the edititemindex to get to the correct "row" in the datalist, and find
the LinkButton control - easier if you use a template,
so you'll know what its ID is. Add the event handler to the LinkButton at
this point.
 
Back
Top