IPostBackEventHandler question

H

Henk

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
 
T

Teemu Keiski

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)
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top