[ASP.NET 2.0] ChangePassword class conflicting with my page

G

Guest

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
 
G

Guest

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??
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top