开发者

Re-generate Code Gen Files in Visual Studio

开发者 https://www.devze.com 2022-12-28 19:56 出处:网络
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 Studi

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.
0

精彩评论

暂无评论...
验证码 换一张
取 消