ItemCommand Event fires twice

J

Jonas Nilsson

Hi!

I have a DataList with some linkbuttons, and when i click them the
eventhandler fires twice.

Is there a way around this?, it's the same problem with the repeater and
datagrid control also.
public void dblFolders_CommandHandler(object sender,
System.Web.UI.WebControls.DataListCommandEventArgs e)
{
if (e.CommandName=="MoveToFolder")
{
FillControls(e.CommandArgument.ToString()); // THIS WILL BE RUN TWICE
}
}

private void InitializeComponent()
{
this.dblFolders.ItemCommand += new
System.Web.UI.WebControls.DataListCommandEventHandler(this.dblFolders_Comman
dHandler);
this.Load += new System.EventHandler(this.Page_Load);
}

/Jonas
 
P

PJ

Have you wired up the event manually as well as defined it in your aspx
element text?
 
J

Jonas Nilsson

Yes.

PJ said:
Have you wired up the event manually as well as defined it in your aspx
element text?


System.Web.UI.WebControls.DataListCommandEventHandler(this.dblFolders_Comman
 

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,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top