Sometimes when I'm editing page or control the .designer files stop being updated with the new controls I'm putting on the page. I'm not sure what's causing this to happen, but I'm wondering if there's any way of forcing Visual Studio to regenerate the .designer file. I'm using Visual Studio 2008
EDIT: Sorry I should have noted I've already tried:
- Closing & re-opening all the files & Visual Studio
- Making a change to a runat="server" control on the page
- Deleting & re-adding the page directive
I had two problems... outdated AJAXControlkit - deleted the old dll, removed old controls from toolbox, downloaded new version, loaded toolbox, and dragged and dropped new controls on the page (see http://www.experts-exchange.com/Programming/Languages/.NET/Visual_Studio_.NET_2005/Q_24591597.html)
Also had misspelling in my label control (had used 'class' instead of 'cssclass').
Ta
My experience is that if you want to do like in this article, like stated above.
Your markup file (aspx/ascx) has to include the CodeBehind="MyPage.aspx.cs" attribute or else it won´t work. I blogged about it here.
If you are using VS2013 or later , make sure that the code referenced with attribute "CodeBehind" not "CodeFile", then do below steps
There is another possibility: You may have an error in your .aspx file that does not allow Visual Studio to regenerate the designer.
If you switch to Design View, it will show the control as unable to be rendered. Fixing the control (in my case it was an extra quote in the properties) and recompiling should regenerate the designer.
in solution explorer just right click and select convert to web application. It will generate all the designer files again.