Recent Posts

Tags

News

  • Now relocated, living and working at Tokyo, Japan.

    Rex Tang, MVP ASP.NET 2006

    This blog is depreciated and not update anymore. Please refer to Rexiology@MSDN Blogs for continuous updates.

    This is a mirror of his technology blog Rexiology::Work

Community

Email Notifications

Microsoft Sites

Other Sites

Blog pools

Bloggers

My other places

Archives

Rexiology...

asp.net, .net framework, etc...

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

 

crosspost from http://rextang.net/blogs/work/

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

Madalina said:

Indeed if you make a Web Site Project that is in fact the only option provided with the original release you will not have access to the code behind. But there is this http://msdn.microsoft.com/asp.net/reference/infrastructure/wap/default.aspx (Visual Studio 2005 Web Application Projects) update and if you make a Web Application Project in the page structure you will find  next to the aspx and aspt.cs files also the file.aspx.designer.cs/vb file. In native 2005 projects too.
# July 27, 2006 11:41 AM
Leave a Comment

(required) 

(required) 

(optional)

(required)