Visual Studio 2008 doesn't generate itself code for added control in .aspx.designer.cs
I added a control on my .aspx page and set Id and runat=server for it but, it doesn't render on my page when I open it in browser as well it doesn't generate code for i开发者_运维知识库t in designer file.
Try that:
1) Remove your_page.designer.cs file.
2) Go to the ASPX page and cut markup, then paste it.
This should force Visual Studio code generation from scratch.
Another try would be check that your control compiles. Sometimes the whole control doesn't compile and you can't add it to the page with success.
Finally, if non of these works for you, you can clean and rebuild your Visual Studio solution.
Matias's appraoch should work another way of doing this is:
- Delete the designer.cs file that is causing issues
- Right click on the aspx file and "make application" (or something to that effect)
This will regenerate the file.
精彩评论