Click Event Not Firing

Discussion in 'ASP .Net Building Controls' started by Hardin Brothers, Feb 10, 2006.

  1. In Framework 1.1 (VS 2003, C#) I've written a server control that contains a
    button. If I place the control on a page surface, it renders fine and the
    button's click event fires, changing the visual state of the control. But
    if I place the control inside the template of another server control I've
    written, the event doesn't fire (the page posts back, but the click never
    gets called.

    I think I'm missing something simple, but what? My ultimate design goal is
    for deeply nested custom controls, something like custom TextBoxes inside of
    a repeater template inside a repeater template inside a page-sized custom
    control. But it's essential that I be able to capture events at the lowest
    levels.

    Thanks in advance for any advice.

    Hardin
     
    Hardin Brothers, Feb 10, 2006
    #1
    1. Advertising

  2. Hardin Brothers

    Teemu Keiski Guest

    Hi,

    can you show the relevant code? Do you also implement INamingContainer
    interface?

    --
    Teemu Keiski
    ASP.NET MVP, AspInsider
    Finland, EU
    http://blogs.aspadvice.com/joteke


    "Hardin Brothers" <no email> wrote in message
    news:...
    > In Framework 1.1 (VS 2003, C#) I've written a server control that contains
    > a button. If I place the control on a page surface, it renders fine and
    > the button's click event fires, changing the visual state of the control.
    > But if I place the control inside the template of another server control
    > I've written, the event doesn't fire (the page posts back, but the click
    > never gets called.
    >
    > I think I'm missing something simple, but what? My ultimate design goal
    > is for deeply nested custom controls, something like custom TextBoxes
    > inside of a repeater template inside a repeater template inside a
    > page-sized custom control. But it's essential that I be able to capture
    > events at the lowest levels.
    >
    > Thanks in advance for any advice.
    >
    > Hardin
    >
     
    Teemu Keiski, Feb 10, 2006
    #2
    1. Advertising

  3. I just found the problem. I had omitted the INamingContainer tag interface
    on the control that contains the template.

    Thanks.
     
    Hardin Brothers, Feb 10, 2006
    #3
    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. Purvi T
    Replies:
    0
    Views:
    922
    Purvi T
    Oct 19, 2004
  2. Ken Cox [Microsoft MVP]

    Button Click event not firing

    Ken Cox [Microsoft MVP], Apr 28, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    1,572
    Andrea Williams
    Apr 28, 2004
  3. Chu
    Replies:
    2
    Views:
    933
    Winista
    Apr 10, 2006
  4. GauravGupta
    Replies:
    4
    Views:
    2,153
    Shilpa1234
    Jan 19, 2012
  5. Max2006
    Replies:
    2
    Views:
    1,637
    Walter Wang [MSFT]
    Sep 19, 2007
Loading...

Share This Page