How to get who causes PostBack?

asp.net, c#, html, postback

Solution

For this you can try

string ctr = Page.Request.Params.Get("__EVENTTARGET");

Here `ctr` will contain your controls's `ID`.

`__EVENTTARGET` carry information who causes page `PostBack`

You can also use `__EVENTARGUMENT` to get argument pass by this control.

Page.Request.Params.Get("__EVENTARGUMENT")

Problem

In my page there are many controls and I want to know who causes page `PostBack` in `Page_Load` event.

Original source