Go Back   DeveloperBarn Forums > Programming & Scripting > .Net Development

Sponsored Links

Discuss "class name is ambiguous" in the .Net Development forum.

.Net Development - Learn about the Microsoft.Net framework and how to create powerful web-based (ASP.net) and client-based (Windows Forms) applications utilizing various languages such as C#, VB.Net, J# and others.


Reply « Previous Thread | Next Thread »
 
LinkBack Thread Tools Display Modes
  #1  
Old May 19th, 2008, 10:01 AM
richyrich's Avatar
Moderator


 
Join Date: Mar 2008
Location: Somewhere only we know...
Posts: 395
Thanks: 26
Thanked 32 Times in 32 Posts
Blog Entries: 1
Rep Power: 1
richyrich will become famous soon enough

Awards Showcase
Classic ASP JavaScript 
Total Awards: 2

Default 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 10:05 AM.
Reply With Quote
Sponsored Links
  #2  
Old May 19th, 2008, 10:11 AM
richyrich's Avatar
Moderator


 
Join Date: Mar 2008
Location: Somewhere only we know...
Posts: 395
Thanks: 26
Thanked 32 Times in 32 Posts
Blog Entries: 1
Rep Power: 1
richyrich will become famous soon enough

Awards Showcase
Classic ASP JavaScript 
Total Awards: 2

Default

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...
Reply With Quote
  #3  
Old May 19th, 2008, 10:19 AM
jmurrayhead's Avatar
The Barnfather

 
Join Date: Mar 2008
Location: Reston, VA, USA
Posts: 820
Thanks: 20
Thanked 74 Times in 71 Posts
Blog Entries: 5
Rep Power: 3
jmurrayhead has a spectacular aura aboutjmurrayhead has a spectacular aura aboutjmurrayhead has a spectacular aura about

Awards Showcase
Microsoft .Net Microsoft SQL Server Microsoft Windows Classic ASP 
Total Awards: 4

Default

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

If it doesn't work, then try renaming it.
__________________
jmurrayhead
If you agree with me... click the icon!
If my post solved your problem, click the button in the lower right-hand corner of the post.

Join our Folding team: DeveloperBarn Folding
Reply With Quote
  #4  
Old May 19th, 2008, 10:41 AM
richyrich's Avatar
Moderator


 
Join Date: Mar 2008
Location: Somewhere only we know...
Posts: 395
Thanks: 26
Thanked 32 Times in 32 Posts
Blog Entries: 1
Rep Power: 1
richyrich will become famous soon enough

Awards Showcase
Classic ASP JavaScript 
Total Awards: 2

Default

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......
Reply With Quote
  #5  
Old May 19th, 2008, 10:45 AM
jmurrayhead's Avatar
The Barnfather

 
Join Date: Mar 2008
Location: Reston, VA, USA
Posts: 820
Thanks: 20
Thanked 74 Times in 71 Posts
Blog Entries: 5
Rep Power: 3
jmurrayhead has a spectacular aura aboutjmurrayhead has a spectacular aura aboutjmurrayhead has a spectacular aura about

Awards Showcase
Microsoft .Net Microsoft SQL Server Microsoft Windows Classic ASP 
Total Awards: 4

Default

Remove this:
Code:
if not isdbnull(rs("dateadded")) then
It's a Nullable type, so you don't have to do this check.
Reply With Quote
  #6  
Old May 19th, 2008, 10:47 AM
richyrich's Avatar
Moderator


 
Join Date: Mar 2008
Location: Somewhere only we know...
Posts: 395
Thanks: 26
Thanked 32 Times in 32 Posts
Blog Entries: 1
Rep Power: 1
richyrich will become famous soon enough

Awards Showcase
Classic ASP JavaScript 
Total Awards: 2

Default

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!!!!!!
Reply With Quote
  #7  
Old May 19th, 2008, 12:12 PM
richyrich's Avatar
Moderator


 
Join Date: Mar 2008
Location: Somewhere only we know...
Posts: 395
Thanks: 26
Thanked 32 Times in 32 Posts
Blog Entries: 1
Rep Power: 1
richyrich will become famous soon enough

Awards Showcase
Classic ASP JavaScript 
Total Awards: 2

Default

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...
Reply With Quote
  #8  
Old May 19th, 2008, 12:34 PM
jmurrayhead's Avatar
The Barnfather

 
Join Date: Mar 2008
Location: Reston, VA, USA
Posts: 820
Thanks: 20
Thanked 74 Times in 71 Posts
Blog Entries: 5
Rep Power: 3
jmurrayhead has a spectacular aura aboutjmurrayhead has a spectacular aura aboutjmurrayhead has a spectacular aura about

Awards Showcase
Microsoft .Net Microsoft SQL Server Microsoft Windows Classic ASP 
Total Awards: 4

Default

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.
Reply With Quote
  #9  
Old May 19th, 2008, 12:52 PM
richyrich's Avatar
Moderator


 
Join Date: Mar 2008
Location: Somewhere only we know...
Posts: 395
Thanks: 26
Thanked 32 Times in 32 Posts
Blog Entries: 1
Rep Power: 1
richyrich will become famous soon enough

Awards Showcase
Classic ASP JavaScript 
Total Awards: 2

Default

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.
Reply With Quote
  #10  
Old May 19th, 2008, 12:57 PM
jmurrayhead's Avatar
The Barnfather

 
Join Date: Mar 2008
Location: Reston, VA, USA
Posts: 820
Thanks: 20
Thanked 74 Times in 71 Posts
Blog Entries: 5
Rep Power: 3
jmurrayhead has a spectacular aura aboutjmurrayhead has a spectacular aura aboutjmurrayhead has a spectacular aura about

Awards Showcase
Microsoft .Net Microsoft SQL Server Microsoft Windows Classic ASP 
Total Awards: 4

Default

is ambiguous in the namespace 'ASP'
Reply With Quote
Reply

  DeveloperBarn Forums > Programming & Scripting > .Net Development

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Class library Shem .Net Development 11 May 22nd, 2008 07:01 AM


All times are GMT -4. The time now is 04:17 PM.



Content Relevant URLs by vBSEO 3.2.0