Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why no designer.cs for ASP.NET Website?

If we create an ASP.NET Web Application in Visual Studio we can see that each and every .aspx file will have an associated auto generated .aspx.designer.cs file. But in case of an ASP.NET WebSite each aspx file has only a codebehind .aspx.cs file only.

My question is why ASP.NET Website does not have an auto generated designer .cs file?

What is the purpose of the auto generated designer file in case of the Web Application project? (I believe no one is touching that designer file)

like image 632
Vishnu Y Avatar asked Mar 21 '23 07:03

Vishnu Y


1 Answers

why ASP.NET Website does not have an auto generated designer .cs file?

Because the code is compiled by the VisualStudio on the fly. Each page is compiled into a separate dll.

What is the purpose of the auto generated designer file in case of the Web Application project?

The designer file is created as a partial class which works as a bridge between aspx and aspx.cs file, which also provides IntelliSense support. No one touches the designer file because visual studio updated it automatically when any changes are made to the aspx file.

Below are references which will provide you more information:

ASP.NET Web Site or ASP.NET Web Application?

aspx.designer.cs how does it work?

like image 123
Amit Avatar answered Mar 23 '23 00:03

Amit