Rexiology::Work

Microsoft, Information Technologies...

News

From Taiwan, living and working at Tokyo, Japan.


follow rextang at http://twitter.com



Rex's Certifications
Rex's Certifications

Site Info



Locations of visitors to this page



Logos & Chicklets


GeoURL


Creative Commons License
This blog is licensed under a Creative Commons License.


Microsoft Sites

Other Sites

Blog pools

Bloggers

My other places

メロメロパーク





Where is [file].aspx.designer.cs in native VS2005 Web Project?

 

Just had a further reading of the migration from ASP.NET 1.1 website to ASP.NET 2.0 one. ScottGu's post listed his Web Application Project, which is a good resource for understanding these topics.

In ScottGu's tutorial article about migrating from ASP.NET 1.1 website to ASP.NET 2.0 one, he mentioned those [file].designer.cs files generated while convering the 1.1 compatible web project, which makes me curious about where were those [file].designer.cs files of native VS2005 web project? basically I can only see those partial classes for my own written code, where were those designer generated control definations go?

By asking Google about this, found out some info via this forum thread and leads me to Rick Strahl's post talking about Page Inheritance in ASP.NET 2.0. According to his post about the new page class creation model, all the designer generated codes are now auto generated by asp.net compiler at compile time. as Rick stated:

Note that a partial class does not contain control definitions or InitializeComponent that usually hooks up the events. ASP.NET generates the surrogate partial class at compile time that represents the ASPX page code ASP.NET generates another partial class that contains all the control definitions, the event delegate hookups and setting of Page settings (like EnableSessionState, Trace etc.).  Both of these partial classes combine to make up the base class that the ASPX page inherits.

That should be the answer why I am not able to find those so-called [file].designer.cs files in native web projects in VS 2005, and Rick's post is a good one to get further understanding of the new ASP.NET 2.0 inheritance model.

Technorati Tags: programming , asp.net

 

Comments

Gulshan said:

I have an ASP.NET 2.0 project. I changed the namespace across the board i.e

(1)Changed the Inherits="<new_namspace>.class_name" in aspx

(2) Changed the namespace in the partial class aspx.cs

I lost all relation between controls in aspx and aspx.cs and the build failed.  So now without a designer.cs which did not exist to begin with I am stuck without any means to tell the compiler what it is supposed to do by design.

# October 1, 2007 4:38 PM
Leave a Comment

(required) 

(required) 

(optional)

(required) 


Enter the numbers above: