Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Re-generate Code Gen Files in Visual Studio

I'm using Visual Studio 2008. I've added a control on a page but can't reference it in code-behind file. When I looked at the Code-Gen file, I didn't find my new control. It looks like Visual Studio didn't update Code Gen file to include my control. Is there a way to manually re-generate that Code Gen file?

like image 843
dev.e.loper Avatar asked Jun 14 '26 19:06

dev.e.loper


1 Answers

If you want to refresh the designer file, you can create it like this:

  • Delete the [NameHere].aspx.designer.cs file.
  • Right click the [NameHere].aspx file.
  • Click Convert to Web Application.
  • Designer file is now re-created, or an error is thrown, letting you know what the issue is with the generation...given your case this is likely, but it'll let you know what to fix, then just click "Convert to Web Application" again once it's fixed.
like image 181
Nick Craver Avatar answered Jun 16 '26 10:06

Nick Craver



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!