Recreate aspx.designer.cs

To generate a new aspx.designer.cs file for your aspx file, (if its corrupted or not updating then delete it) and just right-click the aspx file and select “Convert to Web Application”.

Illustration showing "Convert to Web Application" in Visual Studio