Wednesday, November 24, 2010

What is AutoEventWireup

AutoEventWireup is an attribute attached with the Page directives. AutoEventWireup accept Boolean value i.e. True or False.

AutoEventWireup attribute specify that ASP.Net wire up the code behind events with the page automatically or not. I.e. If you set AutoEventWireup = True then ASP.Net will execute code behind events automatically according to the event name. Event names must be predefined name like Page_Init, Page_Load etc… You need not required to attach handler with events. Disadvantage is that you can’t specify event name.

If you set AutoEventWireup = false, then you need to specify handler of event or you have to bind the event with the control.

Default value of AutoEventWireup is true.

Sometime you got a problem of executing any event two times. It is due to the AutoEventWireup attribute.

No comments:

Post a Comment

DotNet Code Guru