However, strangely I am getting *exactly* the behaviour that you describe. None of the applied solutions has any effect whatsoever. (Feel free to keep the file opened in the text editor so you can inspect changes when it is (or isn't) re-generated correctly.
Sometimes that works (for me), and sometimes it doesn't.
Before trying any solution just try to remove all the error from your aspx or ascx file, as any error on the file will prevent the Visual Studio to create a designer file for you, and it might happen that none of the solution will work for you.
Solution 1 : Right Click on you aspx or ascx file and select "Convert to Web Application".
My project was working fine until I added Recycler View in my project.
Once I added a recyclerview in my project then I noticed I was unable to get the reference of it's id in my file.