Created
April 16, 2012 10:28
-
-
Save icodejs/2397541 to your computer and use it in GitHub Desktop.
what page control caused postback?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function getPostBackControl(page as Page) as string ' what control caused postback? | |
dim control as control = nothing | |
dim ctrlname as string = page.request.Params("__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.ID | |
end function |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment