CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums

MS SQL 2008 on ASP.NET Hosting



Zone: > NEWSGROUP > Asp.Net Forum > visual_studio.vs_2005_web_application_projects Tags:
Item Type: NewsGroup Date Entered: 7/12/2006 8:15:54 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 3 Views: 41 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
4 Items, 1 Pages 1 |< << Go >> >|
amy.baker
Asp.Net User
autoeventwireup Changed to True in C# Conversion to WAP7/12/2006 8:15:54 PM

0/0

Background:

We are converting a project from asp.net 1.1 to 2.0 and also moving from VS2003 to VS2005. We are trying to use VS2005 Web Application Projects.

Issue:

When we selected to Convert to a Web Application Project, the wizard did the following that we did not anticipate:

  1. Changed the autoeventwireup attribute in our aspx, ascx pages to "True". We had it set to false previously  for better performance.
  2. Removed all event wiring from the code behind pages. The OnInit method was removed and the wireup from the InitializeComponent was removed, e.g.:

//Code behind before WAP Conversion:
override protected void OnInit(EventArgs e)
{
  InitializeComponent();
  base.OnInit(e);
}

private void InitializeComponent()
{
  this.Load += new System.EventHandler(this.Page_Load);
}

//Code behind after WAP Conversion:
private void InitializeComponent()
{
}

Questions:

  1. Why is Microsoft pushing autoeventwireup=true? Is it the preferred way to go forward? We have had it set to false in the past for better performance but we don't want to set it to false if Microsoft will be assuming it is true and building on top of that going forward.
  2. Why is it now so hard to change the default to autoeventwireup=false? We have to:
    1. change the templates to include the OnInit and wireup of Page_Load
    2. add wiring code every time we hook up an event
    3. manually add all of the events back into the code behind after the WAP conversion
  3. What is the performance overhead of autoeventwireup=true? It creates delegates at runtime to handle the wiring, correct?
  4. Is there a configuration setting we can set so the autoeventwireup and wiring will not be touched during the WAP conversion?  In order to leave autoeventwireup=false, we have spent many hours after the conversion to try to set it back to false and will have to spend many more hours. Here is what we have had to do manually:
    1. Find and change all of the templates that specify autoeventwireup=true.
    2. Set the autoeventwireup back to false in the aspx, ascx.
    3. Re-add the OnInit() method and all event wiring by looking at code history in our source control and manually adding the event wiring back in. This is obviously a very risky approach. We are in the middle of it and decided to stop until we could get some help.
 
 
 
Ian1971
Asp.Net User
Re: autoeventwireup Changed to True in C# Conversion to WAP8/31/2006 4:47:09 PM

0/0

Hi Amy,

I am running into the same problem. I can't understand why they did this. Performance is worse and I now have a laborious task fixing all the double event firing I now have.

Did you get anywhere with your point 4 so you could convert but leave the autoeventwireup intact?

Regards

Ian
 

Wee Bubba
Asp.Net User
Re: autoeventwireup Changed to True in C# Conversion to WAP8/31/2006 10:46:37 PM

0/0

although this does not help you with your current problem, it may come in useful for future projects.

i suggest wiring your event handlers up in a separate method within each page. then you reference this method from the OnInit event. VS 2003 had a habit of removing any custom handlers whenever i went into design mode, so this is what i did as a fix, and this has also saved me running into the problems you have stated when i ported over to .NET 2.0.

 




MNF
Asp.Net User
Re: autoeventwireup Changed to True in C# Conversion to WAP12/17/2007 1:39:58 AM

0/0

I have similar problem after I've used "Convert to Web Application" menu for my ASCX file that has AutoEventWireup="false".

Convertion left AutoEventWireup="false" in control declaration, but removed all +EventHandler  lines from InitializeComponent.

I had to manually restore them.

I am using VS2005 SP1.


Michael Freidgeim.

My Blog: http://geekswithblogs.net/mnf/
4 Items, 1 Pages 1 |< << Go >> >|


Free Download:


Web:
autoeventwireup Changed to True in C# Conversion to WAP - ASP.NET ... autoeventwireup Changed to True in C# Conversion to WAP. Last post 10-31-2008 3: 09 AM by Abinash Patra. 4 replies. Sort Posts: ...
autoeventwireup Changed to True in C# Conversion to WAP - ASP.NET ... autoeventwireup Changed to True in C# Conversion to WAP. Last post 12-16-2007 8: 39 PM by MNF. 3 replies. Sort Posts:. Oldest to newest, Newest to oldest ...
VS 2005 Web Application Projects on Forums - ASP.NET Forums ... autoeventwireup Changed to True in C# Conversion to WAP. Started 10 months, 3 weeks ago (2007-12-16 20:39:00) by MNF ...
Experiences from migrating to EPiServer 4.61 and ASP.NET 2.0 ... These steps include the conversion from the “web site project format” to the ... to WAP changed the AutoEventWireup setting from “false” to “true” on all ...
CodeProject: Convert the web user controls into custom controls in ... Control Language="C#" AutoEventWireup="true" CodeFile="WebUserControl.ascx.cs" Inherits="WebUserControl" when i try to change it to ...
Converting my Web Store to Web Application Projects - Rick ... Unfortuntately the WAP conversion mucked up the link between the APP_CODE stored ... MessageDisplay" EnableViewState="False" AutoEventWireup="true" %> ...
CoDe Magazine - Article: Compilation and Deployment in ASP.NET 2.0 Listing 5: A WAP page with the ASPX page, CodeBehind Class, and Designer Class. <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ShowPost.aspx.cs" ...
Rodj's Blog In this release the HtmlHelper Form has been changed to BeginForm. .... <%@ Page Language="C#" ContentType="image/png" AutoEventWireup="true" ...
Converting a ASP.NET 2.0 Website to a Web Application Project The WAP makes the web application much closer to an application than to a website. ... Language="C#" AutoEventWireup="true" CodeFile="App/welcome.aspx.cs" ...
CodeProject: Facebook Application Development with FBML, FBJS, ASP ... Mar 6, 2008 ... As you can see, in order to change SPAN innerText , I'm using the setTextValue() method. ..... <%@ Page Language="C#" AutoEventWireup="true" ...




Search This Site:










how to add flash file (movie.swf) into aspx page using visualstudio2005

error accessing sql server connection while creating asp web application

the remote server returned an error

error loading type library/dll

centralized functions - how?

first asp.net application

dynamic database query form how-to

build a dynamic hierarchical menu

co-exits

i project that i will like to do

items as well as sub items

how to forward a value between asp pages

how do i add smtp internet mail authentication to the following code

question on session variables.

asp.net 1.1 - how to get path of referenced assemblies

looping through table controls

other forums?

asp.net card games website

connecting to mysql from dreamweaver

asp.net c# - while statement with recordset

how can i get a control list from a different page

extracting year from mm/dd/yyyy

new to asp.net: declaring variables

what's the difference between expression blen and expression web?

updating dll and error message

debug / web sniffer

directory copy and move

desperately need help – shopping cart

gridview: how many checkboxes checked

ambiguous namespace?

  Privacy | Contact Us
All Times Are GMT