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 u开发者_StackOverflow社区pdate Code Gen file to include my control. Is there a way to manually re-generate that Code Gen file?
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.
精彩评论