The obscure control reference in ASP 1 is the following:
1. Start an ASP.NET project
2. Create two folders: Controls1 and Controls2
3. Create a control named "MyControl" in Controls1
-> webproject/Controls1/MyControl.ascx
4. Create a control named "MyControl" in Controls2
-> webproject/Controls2/MyControl.ascx
5. Create your Default.aspx page and put both controls in it.
6. Build and deploy to your server (this will work on your dev box)
7. Open your test page on your server.
At this point you should have a compiler error on the server that will make
no sense to you. After you turn on the detailed errors, you will see that
your "MyControl" class is already defined - even through you know that it is
not because they are in separate namespaces.
Apparently the ASP.NET compiler does not assign namespaces to the generated
classes that would match their folder hierarchy. Zorch! You can only get
around this by using the "className" attribute in the control's declaration.
Is the same bug in ASP.NET 2.0??
--
Jacob W Anderson
---
http://www.beyond-ordinary.com
http://www.accessquery.com
---
If you think it''s expensive to hire a professional to do the job, wait
until you hire an amateur.
"javatopia" wrote:
> Hello!
>
> I have a web page named "ChangePassword.aspx", which works just wonderful on
> my developer machine. When I deploy it to the server, though, I get:
>
> Compiler Error Message: CS0030: Cannot convert type
> 'ASP.changepassword_aspx' to 'System.Web.UI.WebControls.ChangePassword'
>
> public changepassword_aspx() {
> Line 121: string[] dependencies;
> Line 122: ((ChangePassword)(this)).AppRelativeVirtualPath =
> "~/ChangePassword.aspx";
> Line 123: if ((global::ASP.changepassword_aspx.@__initialized ==
> false)) {
> Line 124: global::ASP.changepassword_aspx.@__stringResource =
> this.ReadStringResource();
>
> I don't like to be negative, but come on! The same thing happened in
> ASP.NET 1.0, so I thought you guys would have figured out how to enforce
> namespaces on compiled pages. In ASP.NET 1.0, you can get similar conflicts
> with web controls that share the same name but are in different namespaces...
>
> How do I get around this without having to change the name of the page???
>
> Thanks
>
> --
> Jacob W Anderson
> ---
> http://www.beyond-ordinary.com
> http://www.accessquery.com
> ---
> If you think it''s expensive to hire a professional to do the job, wait
> until you hire an amateur.
>