LinkButton event not firing

Discussion in 'ASP .Net' started by Mantorok, Feb 21, 2005.

  1. Mantorok

    Mantorok Guest

    Hi

    I have a control generator that is creating controls on the fly, one of the
    controls is a LinkButton, the problem is that the Click event is not firing,
    any ideas?

    Example:

    private void SomeFunc()
    {
    LinkButton link = new LinkButton();

    link.Click += new EventHandler(link_Click);

    private void link_Click(object sender, EventArgs e)

    }

    {

    ObjectList.Show(new ValueRef(bo.Self, "Entries"));

    }

    Thanks

    Kev
    Mantorok, Feb 21, 2005
    #1
    1. Advertising

  2. Mantorok

    Karl Seguin Guest

    Kev:
    SomeFunc() needs to execute on Postback. Since they controls are
    dynamically generated, when the page is posted back, the controls no longer
    exist and thus must be re-recreated.

    Check out
    http://www.denisbauer.com/ASPNETControls/DynamicControlsPlaceholder.aspx
    which might be able to offer some help.

    Karl

    --
    MY ASP.Net tutorials
    http://www.openmymind.net/


    "Mantorok" <> wrote in message
    news:cvcjjd$64d$...
    > Hi
    >
    > I have a control generator that is creating controls on the fly, one of

    the
    > controls is a LinkButton, the problem is that the Click event is not

    firing,
    > any ideas?
    >
    > Example:
    >
    > private void SomeFunc()
    > {
    > LinkButton link = new LinkButton();
    >
    > link.Click += new EventHandler(link_Click);
    >
    > private void link_Click(object sender, EventArgs e)
    >
    > }
    >
    > {
    >
    > ObjectList.Show(new ValueRef(bo.Self, "Entries"));
    >
    > }
    >
    > Thanks
    >
    > Kev
    >
    >
    Karl Seguin, Feb 21, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Solomon Shaffer

    Wrong LinkButton Firing Event - Very Odd

    Solomon Shaffer, Jul 29, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    317
    Solomon Shaffer
    Jul 29, 2004
  2. JoakimR
    Replies:
    3
    Views:
    3,643
    John Saunders
    Jan 8, 2005
  3. Mel
    Replies:
    6
    Views:
    499
  4. webdad3

    asp.net linkbutton event not firing

    webdad3, Jul 6, 2003, in forum: ASP .Net Building Controls
    Replies:
    1
    Views:
    173
    Victor Garcia Aprea [MVP]
    Jul 7, 2003
  5. webdad3

    asp.net linkbutton event not firing

    webdad3, Jul 5, 2003, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    149
    webdad3
    Jul 5, 2003
Loading...

Share This Page