fireing an event fro a button within a datalist

P

Paul Custance

Trying to get a button within a datalist to fire an event. However on
the coding I'm not sure how to link to the button within the datalist.

My data list is called dlorders and the button is called btnEdit and
carries a commandname edit. which then should fire code to open up 2
other buttons, cancel and update.

The label1.text is just test to see if code is firing which it aint!

public void dlOrders_Edit(object
Source,System.Web.UI.WebControls.DataListCommandEventArgs e)
{
//Turn on editing controls
dlOrders.EditItemIndex = e.Item.ItemIndex;
//Re-bind the data
sqlDataAdapter1.Fill(dsOrders1,"Orders");
DataBind();
Label1.Text = "Done";
}

have a created it right?

thanks

Paul Custance
 
P

Paul Custance

Thanks Norman but still no luck! I can get a button outside the datalist
to fire the code, but any buttons within the datalist just do not work.
I have tried changing the CommandName to "Edit" and "EditCommand" but
still nothing. In the Events they are all assigned to fire the
appropriate code, however something is not triggering!

I give up!

thanks

Paul
 

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

Top