I don’t understand what the AutoEventWireUp page property is responsible for.
I’ve read through this article, but even that I don’t understand.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
When a Page is requested, it raises various events which are considered to be part of it’s lifecycle. I keep the visual representation created by Peter Bromberg handy with me.
The
AutoEventWireUpproperty when True, automatically wires up some of these built-in events in the Page life cycle to their handlers. This means that you do not need to explicitly attach these events (using the Handles keyword, for instance, in VB).Examples of these built-in events would be
Page_InitandPage_Load.If you set
AutoEventWireUpto True and provide explicit wiring up of the EventHandlers, you will find them being executed twice! This is one reason why Visual Studio keeps this attribute set tofalseby default.Edit: (after Chester89’s comment)
It is useful to note that the default value of the
AutoEventWireUpattribute of the Page istrue, while the default value of theAutoEventWireUpproperty of the Page class isfalse