IPostBackEventHandler question

Discussion in 'ASP .Net Building Controls' started by Henk, Nov 11, 2006.

  1. Henk

    Henk Guest

    Hey All,


    I have a question about the IPostbackEventHandler interface. This
    interface's RaisePostBackEvent method has an eventArgument paramter. When my
    control has two buttons, I can use eventArgument to see what button was
    clicked, since I set their onclick attribute with the
    Page.ClientScript.GetPostBackEventReference(...) method.

    When I then implement the IPostBackDataHandler interface, and call the
    Page.RegisterRequireRaiseEvent, the RaisePostBackEvent still gets called
    but the eventArgument parameter is always null? Why is this?

    I know I can use the postCollection parameter in
    IPostBackDataHandler::LoadPostData to check which button was clicked, but is
    wonder why the IPostbackEventHandler::RaisePostBackEvent is not usable for
    it anymore?


    regards,

    Henk
    Henk, Nov 11, 2006
    #1
    1. Advertising

  2. Henk

    Teemu Keiski Guest

    It's implemented internally in Framework so that control getting registered
    via RegisterRequiresRaiseEvent won't get the event argument (null is
    passed). I suppose it is indeed presumed that it would be used in scenario
    when the data is available with other means (postCollection in your case).
    other is that Framework doesn't specifically keep track of the registered
    control at that point (it hap├ąpens after postback data has been processed)


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



    "Henk" <> wrote in message
    news:...
    > Hey All,
    >
    >
    > I have a question about the IPostbackEventHandler interface. This
    > interface's RaisePostBackEvent method has an eventArgument paramter. When
    > my control has two buttons, I can use eventArgument to see what button was
    > clicked, since I set their onclick attribute with the
    > Page.ClientScript.GetPostBackEventReference(...) method.
    >
    > When I then implement the IPostBackDataHandler interface, and call the
    > Page.RegisterRequireRaiseEvent, the RaisePostBackEvent still gets called
    > but the eventArgument parameter is always null? Why is this?
    >
    > I know I can use the postCollection parameter in
    > IPostBackDataHandler::LoadPostData to check which button was clicked, but
    > is wonder why the IPostbackEventHandler::RaisePostBackEvent is not usable
    > for it anymore?
    >
    >
    > regards,
    >
    > Henk
    >
    >
    Teemu Keiski, Nov 19, 2006
    #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. =?Utf-8?B?S2xvbSBEYXJr?=

    Table of dynamic buttons implemeting IPostBackEventHandler

    =?Utf-8?B?S2xvbSBEYXJr?=, Jun 17, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    677
    avnrao
    Jun 17, 2004
  2. Sam Martin
    Replies:
    4
    Views:
    7,656
    William F. Robertson, Jr.
    Sep 15, 2004
  3. Mike
    Replies:
    11
    Views:
    4,067
    =?Utf-8?B?aGFuIHpoaXlhbmc=?=
    Sep 22, 2005
  4. Mr Newbie
    Replies:
    1
    Views:
    3,597
    Mr Newbie
    Nov 7, 2005
  5. Louis Somers
    Replies:
    3
    Views:
    3,222
    RichardPetheram
    Oct 17, 2008
Loading...

Share This Page