Geeks With Blogs

News My Blog has been MOVED to

Michael Freidgeim's OLD Blog My Blog has been MOVED to

When ASP.NET page converted to WAP, it changed autoeventwireup to True- see autoeventwireup Changed to True in C# Conversion to WAP  discussion.

Autoeventwireup is easier for coding, but there are  disadvantages(according to MSDN):

One disadvantage of the AutoEventWireup attribute is that it requires that the page event handlers have specific, predictable names. This limits your flexibility in how you name event handlers. Another disadvantage is that performance is adversely affected, because ASP.NET searches for methods at run-time. For a Web site with high traffic volumes, the impact on performance could be significant.

After conversion you should check the code for consistency:

 If autoeventwireup="true", ensure that event wiring from the code behind pages has been removed as well.

If you include explicit binding for page events, be sure that the AutoEventWireup property is set to false so that the method is not called twice.

MSDN recommends that you always set AutoEventWireup to FALSE while working in Visual Studio .NET (from article it is not obvious, is recommendation applicable for VS 2008).
More explanations why AutoEventWireup  should be set to false:
K Scott Allen's "Inside AutoEventWireup" blog and

However ScottGu comment in :
From a performance measurement perspective, there is no difference between autoeventwireup=true/false.

Posted on Wednesday, March 25, 2009 1:47 AM ASP.NET | Back to top

Comments on this post: ASP.NET Conversion to WAP bug - autoeventwireup Changed to True

No comments posted yet.
Your comment:
 (will show your gravatar)

Copyright © Michael Freidgeim | Powered by: