Re: Determining which Button was pressed
From: Keith Patrick (richard_keith_patrick_at_hotmail.com)
Date: 02/22/05
- Next message: Joe: "Mailer, Newsletter script in asp/asp.net"
- Previous message: Peter Rilling: "Re: draw line on image"
- In reply to: Steve C. Orr [MVP, MCSD]: "Re: Determining which Button was pressed"
- Next in thread: Steve C. Orr [MVP, MCSD]: "Re: Determining which Button was pressed"
- Reply: Steve C. Orr [MVP, MCSD]: "Re: Determining which Button was pressed"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 22 Feb 2005 15:37:58 -0600
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: Joe: "Mailer, Newsletter script in asp/asp.net"
- Previous message: Peter Rilling: "Re: draw line on image"
- In reply to: Steve C. Orr [MVP, MCSD]: "Re: Determining which Button was pressed"
- Next in thread: Steve C. Orr [MVP, MCSD]: "Re: Determining which Button was pressed"
- Reply: Steve C. Orr [MVP, MCSD]: "Re: Determining which Button was pressed"
- Messages sorted by: [ date ] [ thread ]