1

Having been a web site designer for many years, I'm moving across to web applications in Visual Studio. Many projects currently involve migrating web sites to web applications.

Following migration, within VS, for each of my ASPX web forms files, I get the usual code-behind file (*.cs as before), and also now a *.designer.cs file.

Every .designer file contains an empty partial class with a warning that the file was generated by a tool.

I know that within winforms, the designer files hold the data regarding the form control layouts, but in web applications, the ASPX file already has this logic. So why are designer files generated for web applications, and what is their use?

EvilDr
  • 8,943
  • 14
  • 73
  • 133
  • possible duplicate of [Why no designer.cs for ASP.NET Website?](http://stackoverflow.com/questions/22248057/why-no-designer-cs-for-asp-net-website) – Abhitalks Nov 12 '14 at 11:38
  • Yes it is a duplicate. I did search but missed the question you link to. **However**, the answer in the page @Ratna links to is far better than the one linked to above so its more a duplicate of http://stackoverflow.com/questions/3284710/aspx-designer-cs-how-does-it-work – EvilDr Nov 12 '14 at 13:24
  • Yes :) But does this question answer you "why" it is needed in WAP but not in Websites? It tells you its role in WAP, but doesn't tell you why that role is not required in Website. That's why the question I linked to. Answer in that question tells you exactly that and also links to the same question Ratna linked to (the second link). – Abhitalks Nov 12 '14 at 13:28
  • Do you not get intellisense in website projects? Do websites projects not use server-side controls? Do website projects not need definition of all controls? Why do Web Application Projects need that? – Abhitalks Nov 12 '14 at 13:31

1 Answers1

3

I know that within winforms, the designer files hold the data regarding the form control layouts, but in web applications, the ASPX file already has this logic. So why are designer files generated for web applications, and what is their use?

But your this assumption is wrong ->the ASPX file already has this logic

Aspx file do not have any logic atleast not in programmed format. So you create a intermediate file which define all the controls and also provide intellisence for those control.

See this link for more aspx.designer.cs how does it work?

Community
  • 1
  • 1
Ratna
  • 2,289
  • 3
  • 26
  • 50