Many thanks to Ryan Farley (http://www.ryanfarley.com/blog/archive/2005/03/11/1886.aspx) for this code. I converted the C# to VB for my own project. Saved my sanity it did!Public Shared Function GetPostBackControl(ByVal page As Page) As Control
Dim control As Control = NothingDim ctrlname As String = page.Request.Params.[Get]("__EVENTTARGET")
If ctrlname IsNot Nothing AndAlso ctrlname <> String.Empty Then
control = page.FindControl(ctrlname)
Else
For Each ctl As String In page.Request.Form
Dim c As Control = page.FindControl(ctl)
If TypeOf c Is System.Web.UI.WebControls.Button Then
control = c
Exit For
End If
Next
End If
Return control
End Function
-
GetPostBackControl
@ 2008-05-01 – 12:47:53
-
England vs Brazil
@ 2007-06-01 – 20:19:49
Not convinced by either side so far.
But at least I'm sitting here writing this and watching the football on the laptop. Given that a new lease of life I have with upgrading the memory, I'd almost describe it now as zippy!!
Shows how bad it must have been before...
-
Skype & Backgammon
@ 2007-02-21 – 15:22:15
Downloaded the latest Skype today (version 3.0.0.217). It comes with some games included, one of which I played with Dave, Backgammon. Absolutely stuffed him I did, 2-0, before he had to "go to lunch". More like skulked off and licked his wounds....
