tag:blogger.com,1999:blog-6908201609754153877.post7362925671236316634..comments2023-09-04T10:03:55.470+02:00Comments on Developing dotnet architect: Clicking a winforms button from codeDanhttp://www.blogger.com/profile/14787263872119403136noreply@blogger.comBlogger6125tag:blogger.com,1999:blog-6908201609754153877.post-47932090233548801672008-11-27T15:11:00.000+01:002008-11-27T15:11:00.000+01:00If you are trying to do this on a webform, the Cli...If you are trying to do this on a webform, the Click event handler won't be set from start when the webrequest begins. See the <A HREF="http://john-sheehan.com/blog/wp-content/uploads/aspnet-life-cycles-events.pdf" REL="nofollow">aspnet life cycle events</A> chart for getting an idea when the event handler is available.Danhttps://www.blogger.com/profile/14787263872119403136noreply@blogger.comtag:blogger.com,1999:blog-6908201609754153877.post-8055570315401976802008-11-27T14:33:00.000+01:002008-11-27T14:33:00.000+01:00Hi,thanks, but actually it wasn't for testing. I t...Hi,<BR/><BR/>thanks, but actually it wasn't for testing. I tried to implement something like a "PreviewClickEvent":<BR/><BR/>I need an event that gets called before all other events get called. Furthermore I have no access to the code of the original EventHandler and therefore I thought I could extract the original EventHandlers and replace them with my "PreviewEventHanlder".<BR/><BR/>In this PreviewEventHanlder I would do some stuff and then call the original EventHandler afterwards.<BR/><BR/>The only problem is that I'm not able to get the original EventHandlers. If I call "get_Events" via Refelction I only receive an empty EventHandlerList...<BR/><BR/>Never mind, I'll think of something else<BR/><BR/>Cheers,<BR/><BR/>Mario M.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-6908201609754153877.post-68812720433354850452008-11-27T14:11:00.000+01:002008-11-27T14:11:00.000+01:00Well, not in that sense. It all depends on your pu...Well, not in that sense. It all depends on your purpose. Is it for unit testing your webform or what?<BR/>In that case, I recommend the <A HREF="http://asp.net/mvc" REL="nofollow">ASP.NET MVC framework</A> that eases testing a lot (but you need a different setup than an ordinary asp.net web project).Danhttps://www.blogger.com/profile/14787263872119403136noreply@blogger.comtag:blogger.com,1999:blog-6908201609754153877.post-57688693405715777132008-11-27T13:30:00.000+01:002008-11-27T13:30:00.000+01:00Thanks! I hoped that I could use it for a "WebCont...Thanks! I hoped that I could use it for a "WebControls.Button" too, but unfortunately it didn't work... thanks anyway...Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-6908201609754153877.post-54933500393307644282008-11-27T12:37:00.000+01:002008-11-27T12:37:00.000+01:00Hi, well of course. This is no standard method and...Hi, well of course. This is no standard method and I have added a <A HREF="http://dhvik.blogspot.com/2008/11/getfield-method.html" REL="nofollow">new post regarding the GetField method</A>.<BR/>Hope this will help you!<BR/><BR/>Good luck.<BR/>/DanDanhttps://www.blogger.com/profile/14787263872119403136noreply@blogger.comtag:blogger.com,1999:blog-6908201609754153877.post-12941494854521243552008-11-27T11:28:00.000+01:002008-11-27T11:28:00.000+01:00Hi! Great!Would you mind telling me what's in the ...Hi! Great!<BR/><BR/>Would you mind telling me what's in the "GetField" method? ;-) I tried to write my own but it returns always an empty EventHandlerList.<BR/><BR/>Regards,<BR/><BR/>Mario M.Anonymousnoreply@blogger.com