Aspx designer cs file not updating
-- Hope this helps, Mark Fitzpatrick Former Microsoft Front Page MVP 199? NET : Framework 2.0 - C# A recent addition to my code generater will create Grid View's and Object Data Source's in a control (ASCX). I now wanted to use it for another project (B), but when refreshing the files in the website, only the cs file nests under the file.
So I suspect that the 2 issues are related: the fact that VS doesn't think that the designer file is the same as the cs file (even though they are both partial classes and have the same name) and the fact that it can't compile because of a problem with the type (whatever that means). Does anyone know the criteria that VS uses to nest related files? Web sites in 2.0 don't let you specify a default namespace. However, the namespace for the designer, ascx, and files are all the same. Thanks, Steven Hi Mark, It is definately a web site. This file obviously does not cause any errors during build.
The tool-generated hidden block above is also a little "messy" for some people's tastes.
2) The control-declarations are only updated when a developer using VS 2003 activates the WYSIWYG page designer.
The error occurs because something within that page is preventing it from building.
You may want to add the Output window to the project as it will often show errors in the build process that you may now catch otherwise.
At compile-time, these files are compiled together and generate a single code-behind class.
Developers can then program directly against this control within their code-behind file.
VS 2003 automatically adds/updates these protected control field declarations at the top of the code-behind file (these are updated everytime a developer switches into WYSIWYG design-view): VS 2003 also then maintains a hidden region block inside the code-behind of tool-generated code to register event-handlers and keep them in sync with the design-surface: There are two common complaints/problems with this: 1) VS 2003 is adding/deleting code in the same file where the developer is authoring their own code -- and accidental conflicts/mistakes do end up happening (for example: some code that the developer writes can sometimes get modified or deleted by VS).
Output window doesn't reveal anything other than this: E:\Work\Projects\Internet Connection Monitor\ICMWeb\Controls\Grids \Setting Grid.ascx(1): Build (web): Could not load type 'Setting Grid'.
The below tutorial helps explain the code-behind model and project structure of pages built within VS 2005 Web Application Projects.