S
Steven Nagy
Hi all,
ASP.NET : Framework 2.0 - C#
A recent addition to my code generater will create GridView's and
ObjectDataSource's in a control (ASCX).
So the code gen creates an ascx, ascx.cs, ascx.designer.cs and a
stylesheet.
The 3 control files are placed together.
When generating for project A, the control files (after refresh)
appear all nested properly, eg.
+ TestGrid.ascx
- TestGrid.ascx.cs
- TestGrid.ascx.desginer.cs
... and compiles nicely and works perfectly.
I now wanted to use it for another project (B), but when refreshing
the files in the website, only the .ascx.cs file nests under the .ascx
file. The designer file does not nest; it simply sits at the same
level as the ascx. Clicking "nest related files" over and over makes
no difference.
Project B also does not build. The error is as follows (where UserGrid
is the name of the control):
"Could not load type: 'ICMWeb.UserGrid'
.... and this error occurs on line 1 of the ASCX file (the @
directive). THe code behind file is correct, and the inherits
attribute is also correct.
This error naturally occurs for every control I generate.
Also, when I delete ALL asp code from the .ascx file except for the
directive, it still fails.
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 .ascx.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).
Any suggestions?
Does anyone know the criteria that VS uses to nest related files? This
could lead in to identifying the problem.
Also, what's happening with namespaces here? When I create a new site,
pages I add are not namespaced, but the controls I generated ARE
namespaced. Web sites in 2.0 don't let you specify a default
namespace. This could also be related. However, the namespace for the
designer, ascx, and ascx.cs files are all the same.
Any help is appreciated.
Thanks,
Steven
ASP.NET : Framework 2.0 - C#
A recent addition to my code generater will create GridView's and
ObjectDataSource's in a control (ASCX).
So the code gen creates an ascx, ascx.cs, ascx.designer.cs and a
stylesheet.
The 3 control files are placed together.
When generating for project A, the control files (after refresh)
appear all nested properly, eg.
+ TestGrid.ascx
- TestGrid.ascx.cs
- TestGrid.ascx.desginer.cs
... and compiles nicely and works perfectly.
I now wanted to use it for another project (B), but when refreshing
the files in the website, only the .ascx.cs file nests under the .ascx
file. The designer file does not nest; it simply sits at the same
level as the ascx. Clicking "nest related files" over and over makes
no difference.
Project B also does not build. The error is as follows (where UserGrid
is the name of the control):
"Could not load type: 'ICMWeb.UserGrid'
.... and this error occurs on line 1 of the ASCX file (the @
directive). THe code behind file is correct, and the inherits
attribute is also correct.
This error naturally occurs for every control I generate.
Also, when I delete ALL asp code from the .ascx file except for the
directive, it still fails.
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 .ascx.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).
Any suggestions?
Does anyone know the criteria that VS uses to nest related files? This
could lead in to identifying the problem.
Also, what's happening with namespaces here? When I create a new site,
pages I add are not namespaced, but the controls I generated ARE
namespaced. Web sites in 2.0 don't let you specify a default
namespace. This could also be related. However, the namespace for the
designer, ascx, and ascx.cs files are all the same.
Any help is appreciated.
Thanks,
Steven