User-1545767719 posted
Could somehow the lack of a designer file create the problem with missing 'withevents'? If so, why is the designer file missing?
Please read the "To copy a Web site project to a Web application project" and "Converting the Project Files" sections in the following Microsoft document:
Walkthrough: Converting a Web Site Project to a Web Application Project in Visual Studio
Here is extraction which will answer to your question:
“One difference between a Web site project and a Web application project is that in a Web site project, ASP.NET dynamically generates partial classes for ASP.NET Web Forms pages and user controls. After you copy the files from the Web site project
to the Web application project, you will notice that the code-behind files for each page and user-control are still associated with the .aspx, .master, and .ascx files. No .designer.cs or .designer.vb files have been generated. As part of the next step, you
convert these pages to save their partial classes in a .designer.cs or .designer.vb file.”