Re: Determining which Button was pressed
From: Steve C. Orr [MVP, MCSD] (Steve_at_Orr.net)
Date: 02/22/05
- Next message: jennifer1970_at_hotmail.com: "Re: Select DataGrid Row from code"
- Previous message: Kevin Spencer: "The Demise of C#"
- In reply to: Keith Patrick: "Re: Determining which Button was pressed"
- Next in thread: Keith Patrick: "Re: Determining which Button was pressed"
- Reply: Keith Patrick: "Re: Determining which Button was pressed"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 22 Feb 2005 13:44:52 -0800
We haven't been talking about much more than basic object oriented concepts
here, so you're likely to encounter similar issues in virtually any modern
language or platform.
However, the ASP.NET page lifecycle does tend to throw some complex timing
issues into the mix, so perhaps your frustrations are centered around that.
Here are some links that may help in that regard:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconcontrolexecutionlifecycle.asp
http://www.15seconds.com/issue/020102.htm
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbconWebFormsPageProcessingStages.asp
-- I hope this helps, Steve C. Orr, MCSD, MVP http://SteveOrr.net "Keith Patrick" <richard_keith_patrick@hotmail.com> wrote in message news:ON8DSbSGFHA.1296@TK2MSFTNGP10.phx.gbl... > Yeah, that looks to be about my only option. It's odd...I've been running > into more walls with regards to ASP.Net, whether it be consistency (or > lack thereof) or a ridiculous # of hoops to get through to do some simple > HTTP things, and it has been absolutely driving me nuts. I guess after > being so productive with it for so long, I just expected it to expose > certain things to make more advanced things possible (a form of an > inductive UI, if you will), but the deeper I dig, the more I get let down > with regards to my expectations. > > "Steve C. Orr [MVP, MCSD]" <Steve@Orr.net> wrote in message > news:%235gDhSSGFHA.2756@TK2MSFTNGP15.phx.gbl... >> The user control could expose a public property that specifies the button >> that was clicked. >> >> -- >> I hope this helps, >> Steve C. Orr, MCSD, MVP >> http://SteveOrr.net >> >> >> "Keith Patrick" <richard_keith_patrick@hotmail.com> wrote in message >> news:%23pZ$eOSGFHA.1396@tk2msftngp13.phx.gbl... >>>I have a web page that has a bunch of usercontrols, each declaring a >>>Button called "GoButton". Now, my parent page has to be able to >>>determine which button triggered the event. The catch is: I'd like to >>>use the same algorithm for every control, and right now, my algorithm is >>>"sender = this.FindControl(Request["__EVENTTARGET"]", but the problem is >>>that those buttons always get rendered as type="submit", even if I assign >>>a CommandName and/or CommandArgument, leading the >>>Request["__EVENTTARGET"] for Button presses to be String.Empty. >>> >>> The event itself has the sender, but that code is in the usercontrol, >>> not the page. What this means for me is that I could hack in a solution >>> via temporary variables or passing a sender ID in the QueryString, but >>> I'd much rather find a way to crack the Button rendering and just have >>> it render as type="button" where onclick="javascript:__doPostBack(...)" >>> just like every other control I've got to handle. >>> >> >> > >
- Next message: jennifer1970_at_hotmail.com: "Re: Select DataGrid Row from code"
- Previous message: Kevin Spencer: "The Demise of C#"
- In reply to: Keith Patrick: "Re: Determining which Button was pressed"
- Next in thread: Keith Patrick: "Re: Determining which Button was pressed"
- Reply: Keith Patrick: "Re: Determining which Button was pressed"
- Messages sorted by: [ date ] [ thread ]