Best practice for editing a Datalist

R

Ryu

Hi

I have method that binds data to the DataList.

void BindControls()
{
//Code Here
DataList.DataBind();
}

And I have a ItemBound event that will fire after DataBind() is called.
Right now I would like to edit the selected index in the DataList (dl).

private void d_EditCommand(object source, DataListCommandEventArgs e)
{
BindControls();
}
As you can see, I have to call BindControls() again which will have to make
calls to the database again. I don't think this method is very effiicient.
Is there any workaround to fire the ItemBound event without going through
the BindControls()?



Thanks
 

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,763
Messages
2,569,563
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top