Ver Mensaje Individual
  #1 (permalink)  
Antiguo 26/08/2011, 10:33
Avatar de jahman
jahman
 
Fecha de Ingreso: noviembre-2003
Ubicación: Oslo
Mensajes: 230
Antigüedad: 20 años, 5 meses
Puntos: 0
Dynamic LinkButton no Ejecuta el evento

HOla tengo el siguiente linkbutton generado dinamicamente

Código:
LinkButton lblLoc = new LinkButton();
            lblLoc.ID = "lblLocal_" + i;
            lblLoc.Text = infoTxp.Local + "<br />";
            lblLoc.Command += new CommandEventHandler(EculinkInfo);
            lblLoc.CommandName = infoTxp.Tarjetacuenta.ToString();            
            if (infoTxp.FechaTrx == Dt)
                lblLoc.Attributes.Add("style", "color:red;");
            phLocal.Controls.Add(lblLoc);


protected void EculinkInfo(object sender, CommandEventArgs e)
    {
        Form form = (Form)LoadControl("~/Form.ascx");
        form.TarjetaCuenta = e.CommandName;
        Item.Controls.Clear();
        Item.Controls.Add(form);

    }
la cosa es que no ejecuta el evento pero cuando coloco

<asp:LinkButton ID="wer" runat="server" Text="123" OnCommand="EculinkInfo" CommandName="123"></asp:LinkButton>

lo ejecuta perfectamente alguien sabe xq ?
Gracias