DataList ItemCommand Needs two clicks

J

John Famiglietti

Hi All,

I'm using a pretty straightforward implementation of the DataList control.
I'm only databinding if !IsPostBack, but I need to click on a button whose
ItemCommand is DataList.SelectCommandName twice in order for the item to
become selected.

On the first click, my ItemCommand handler is never called, on the second
click it works fine. However, if I remove the if IsPostBack restriction
from my On_Load handler, ItemCommand does get called the first time. (but
obviously I can't leave it that way.)

All the other commands work fine. (Edit, Update, Delete and Cancel)

I've seen tons of other messages like mine in Google groups, but none with
any real resolution. Maybe I'll get lucky.

Thanks,
John
 
J

John Famiglietti

I got it.

For anyone else that might run into this:

When databinding my select button, I was setting its ID. I noticed the ID
in the doPostBack call was different the first time from the second time and
when I removed the code to set its ID, it worked fine.
 

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,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top