Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Building Controls / November 2006

Tip: Looking for answers? Try searching our database.

IPostBackEventHandler question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Henk - 11 Nov 2006 21:17 GMT
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 - 19 Nov 2006 20:15 GMT
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)

Signature

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

> Hey All,
>
[quoted text clipped - 16 lines]
>
> Henk

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.