Wednesday, July 15, 2009

To check Control Id which makes Postback in a page

If you want to detect which control on a page occured Postback
You can get by this line in an CreateChildControls function

Dim ctrlName As String = Request.Params.Get("__EVENTTARGET")

Protected Overrides Sub CreateChildControls()
MyBase.CreateChildControls()

Dim ctrlName As String = Request.Params.Get("__EVENTTARGET")

End Sub