Wednesday, April 28, 2010

Page load event is fired twice with user control

One very strange behaviour that i noticed is that, page load event is fired twice. It started with page load and then followed by postback.

What I have:
1. Ajax Page
2.User Control
3.Asp.net C# page

After going through many testing and debugging, i realize that after setting the auto event wire up as false, everything is back to 'normal'.

To know which control trigger the postback, apart from using ___EventTarget to track, refer to this post, it contains a more comprehensive approach.

Page AutoEventWireup="false"

No comments:

Post a Comment