RaisePostBackEvent and Web Controls Event Handlers

Discussion in 'ASP .Net Building Controls' started by Lucas Tam, Aug 31, 2003.

  1. Lucas Tam

    Lucas Tam Guest

    If RaisePostBackEvent fires, does this disable Webcontrols events?

    It seems when RaisePostBackEvent, my webcontrols event handlers such as
    button.click no longer work.

    So, what is the best way of mixing non-composite controls and web controls?

    Thanks!

    --
    Lucas Tam ()
    Please delete "REMOVE" from the e-mail address when replying.
    http://members.ebay.com/aboutme/coolspot18/
    Lucas Tam, Aug 31, 2003
    #1
    1. Advertising

  2. Lucas Tam

    Teemu Keiski Guest

    Hmm, perhaps you mean something else? If RaisePostBackEvent fires on your
    control, it means your control has fired the postback itself and therefore
    for example some other Button's Click event isn't fired. This is as Button
    fires its Click even when the button is clicked (Button raises the Click
    event by handling IPostBackEventHandler).

    So if your control's child control like Button would cause postback, the
    containing control's RaisePostBackEvent would not be called. This is if you
    use composition approach i.e have the button as child control by creating in
    CreateChildControls as the idea with child controls is that they already
    contain ready logic to handle things and so on. Generally for such control
    event handlers are wired in the CreateChildControls as well.

    Case is different if the contained button would be "implemented" via
    rendering and the actual action it fires is done by calling to
    Page.GetPostBackEventReference when of course the source for postback is
    your control itself.

    --
    Teemu Keiski
    MCP, Designer/Developer
    Mansoft tietotekniikka Oy
    http://www.mansoft.fi

    AspInsiders Member, www.aspinsiders.com
    ASP.NET Forums Moderator, www.asp.net
    AspAlliance Columnist, www.aspalliance.com




    "Lucas Tam" <> wrote in message
    news:Xns93E87C83E4FC8nntprogerscom@140.99.99.130...
    > If RaisePostBackEvent fires, does this disable Webcontrols events?
    >
    > It seems when RaisePostBackEvent, my webcontrols event handlers such as
    > button.click no longer work.
    >
    > So, what is the best way of mixing non-composite controls and web

    controls?
    >
    > Thanks!
    >
    > --
    > Lucas Tam ()
    > Please delete "REMOVE" from the e-mail address when replying.
    > http://members.ebay.com/aboutme/coolspot18/
    Teemu Keiski, Aug 31, 2003
    #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. Lucas Tam
    Replies:
    0
    Views:
    403
    Lucas Tam
    Aug 19, 2003
  2. Sam Martin
    Replies:
    4
    Views:
    7,642
    William F. Robertson, Jr.
    Sep 15, 2004
  3. =?Utf-8?B?Tm92aWNl?=
    Replies:
    1
    Views:
    458
    John Saunders
    Sep 23, 2004
  4. Dario
    Replies:
    0
    Views:
    400
    Dario
    May 14, 2007
  5. Dica
    Replies:
    1
    Views:
    400
    bruce barker
    Jun 20, 2007
Loading...

Share This Page