I have created a big form witch is being loaded as a usercontrol. On the initial page load there is an automatic postback when the page is fully loaded.
Is there a way to find what control is triggering this postbac and why.
Thanx in advance!
I have created a big form witch is being loaded as a usercontrol. On the initial page load there is an automatic postback when the page is fully loaded.
Is there a way to find what control is triggering this postbac and why.
Thanx in advance!
Stop on a breakpoint in Page_Load
under if(IsPostBack)
and inspect Request["__EVENTTARGET"]
and Request["__EVENTARGUMENT"]
values.
Finally found the answer, the other answer didn't work for me since it was a linkbutton. These apparently don't show up using the method suggested by @Igor
Solved the problem using the following javascript:
<script>
var postbackControl = null;
var parm = Sys.WebForms.PageRequestManager.getInstance();
parm.add_beginRequest(BeginRequestHandler);
function BeginRequestHandler(sender, args) {
postbackControl = args.get_postBackElement();
console.log(postbackControl);
}
</script>
It sends the control triggering the postback to the browserconsole, including all the objects attributes.