Click event in a datalist to post back datalist properties

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
 
R

Rick Spiewak

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,905
Latest member
Kristy_Poole

Latest Threads

Top