event handler not firing for dataList edit item

W

Wee Bubba

if you put a row of my dataList into edit mode there is a button. I am
trying to attach to an existing event handler like this (C#):

public void EditRowHandler (Object src, DataListCommandEventArgs e)
{
...
Button myBtnt = (Button)
dl1.Items[e.Item.ItemIndex].FindControl("btnSMEdit");

myBtn.Click += new EventHandler(btnSearch_Click);
}

i know the code has successfully captured my button because I can
alter the button's Text property OK. also from debugging I know my
event handler is not even being called for some reason.

why is my button not calling the event handler?
 

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

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top