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

Discussion in 'ASP .Net' started by =?Utf-8?B?amF2YXRvcGlh?=, Apr 15, 2006.

  1. 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.
     
    =?Utf-8?B?amF2YXRvcGlh?=, Apr 15, 2006
    #1
    1. Advertising

  2. 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.
    >
     
    =?Utf-8?B?amF2YXRvcGlh?=, Apr 17, 2006
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?bmljaw==?=

    asp:ChangePassword question

    =?Utf-8?B?bmljaw==?=, Jul 2, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    1,300
    =?Utf-8?B?c2FyYQ==?=
    Jul 2, 2006
  2. Ben Engbers
    Replies:
    0
    Views:
    504
    Ben Engbers
    Feb 7, 2007
  3. kiran kumr

    Conflicting class keyword

    kiran kumr, Jan 10, 2007, in forum: C++
    Replies:
    5
    Views:
    339
    Jim Langston
    Jan 12, 2007
  4. Ken Fine
    Replies:
    2
    Views:
    1,761
    Allen Chen [MSFT]
    Aug 25, 2008
  5. Savvoulidis Iordanis
    Replies:
    6
    Views:
    1,439
    Gregory A. Beamer
    Dec 3, 2009
Loading...

Share This Page