+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12

Thread: class name is ambiguous

  1. #1
    Administrator richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich's Avatar
    Join Date
    Mar 2008
    Location
    Somewhere only we know...
    Posts
    3,207
    Blog Entries
    14
    Real Name
    Rich
    Rep Power
    14

    class name is ambiguous

    I keep getting errors saying "master_pc is ambiguous in the namespace 'ASP' when loading some of my pages.

    master_pc is the name of my main Public class in my Master Page.

    The Error is on line:
    Code:
    Public Shadows ReadOnly Property Master() as ASP.master_pc
    
    Could someone give me an idea of how to fix this other than renaming the class? There is no other class called this, so I'm at a loss as to why it's having a problem.

    <edit>The file it references is App_Web_..... which I presume is one created by .Net during compilation</edit>
    Last edited by richyrich; May 19th, 2008 at 11:05 AM.

  2. #2
    Administrator richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich's Avatar
    Join Date
    Mar 2008
    Location
    Somewhere only we know...
    Posts
    3,207
    Blog Entries
    14
    Real Name
    Rich
    Rep Power
    14

    If I change the properties in the Master Page to shared then I get another ambiguous error saying "master_pc is ambiguous".

    This time it relates to code in my content page that's trying to access a shared property in the master page.
    Code:
    master_pc.connString
    
    Where am I going wrong?

    I've only started having this problem recently...

  3. #3
    The Barnfather jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead's Avatar
    Join Date
    Mar 2008
    Location
    Reston, VA
    Posts
    4,533
    Blog Entries
    9
    Real Name
    Jason
    Rep Power
    22

    See this: '<name>' is ambiguous in the namespace '<namespacename>'

    If it doesn't work, then try renaming it.
    jmurrayhead
    If you agree, give me rep.
    If you like it here...throw us a few bones to help support us.


  4. #4
    Administrator richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich's Avatar
    Join Date
    Mar 2008
    Location
    Somewhere only we know...
    Posts
    3,207
    Blog Entries
    14
    Real Name
    Rich
    Rep Power
    14

    Hmmm....I renamed it before when I had this problem. Renamed it again and it's working again.

    Now I'm getting another error, "Nullable object must have a value" on one of my date fields, even though the field in the db does have a value in it and I'm using if not isdbnull(rs("dateadded")) then to populate the field......

  5. #5
    The Barnfather jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead's Avatar
    Join Date
    Mar 2008
    Location
    Reston, VA
    Posts
    4,533
    Blog Entries
    9
    Real Name
    Jason
    Rep Power
    22

    Remove this:
    Code:
    if not isdbnull(rs("dateadded")) then
    
    It's a Nullable type, so you don't have to do this check.
    jmurrayhead
    If you agree, give me rep.
    If you like it here...throw us a few bones to help support us.


  6. #6
    Administrator richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich's Avatar
    Join Date
    Mar 2008
    Location
    Somewhere only we know...
    Posts
    3,207
    Blog Entries
    14
    Real Name
    Rich
    Rep Power
    14

    I tried making a change to fix the date problem and now it's saying the name of the class in my Master page is ambiguous again...

    This is doing my head in!!!!!!

  7. #7
    Administrator richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich's Avatar
    Join Date
    Mar 2008
    Location
    Somewhere only we know...
    Posts
    3,207
    Blog Entries
    14
    Real Name
    Rich
    Rep Power
    14

    OK. I think I may have solved this issue, fingers crossed.

    It seems that if the class of my content page was set to partial, I got the error. If I set it to Public, it stopped the error.

    I had a similar issue with a user control. I removed the ClassName attribute from the Control declaration and kept the class as Partial and that seemed to solve that.

    Fingers crossed this won't start happening again now...

    Just a note J. On the date fields, if I have a field value as NULL and I don't have if not isdbnull() it threw an error. Damn annoying...

  8. #8
    The Barnfather jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead's Avatar
    Join Date
    Mar 2008
    Location
    Reston, VA
    Posts
    4,533
    Blog Entries
    9
    Real Name
    Jason
    Rep Power
    22

    That's odd, because I have a property:

    Code:
    Private _myDate As Nullable(Of Date)
    Public Property MyDate() As Nullable(Of Date)
        Get
            Return _myDate
        End Get
        Set(ByVal value As Nullable(Of Date))
            _myDate = value
        End Set
    End Property
    
    And this works when passing NULL dates.

    As far as the declaration of your class...you should be able to keep it as Partial...there must be something else wrong with your code.
    jmurrayhead
    If you agree, give me rep.
    If you like it here...throw us a few bones to help support us.


  9. #9
    Administrator richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich's Avatar
    Join Date
    Mar 2008
    Location
    Somewhere only we know...
    Posts
    3,207
    Blog Entries
    14
    Real Name
    Rich
    Rep Power
    14

    Must be...It's just happened again with the class set to Public.

    How do I find out what the "real" problem is, because it's obviously not that the class name is ambiguous?

    Maybe I'll try re-jigging things, so the shared properties I want are in my BO layer. See if that helps.

  10. #10
    The Barnfather jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead's Avatar
    Join Date
    Mar 2008
    Location
    Reston, VA
    Posts
    4,533
    Blog Entries
    9
    Real Name
    Jason
    Rep Power
    22
    jmurrayhead
    If you agree, give me rep.
    If you like it here...throw us a few bones to help support us.


+ Reply to Thread
Page 1 of 2 1 2 LastLast

Similar Threads

  1. Class library
    By Shem in forum .NET Development
    Replies: 11
    Last Post: May 22nd, 2008, 08:01 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

SEO by vBSEO