Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Nested Classes, is it possible?

Status
Not open for further replies.

Ken011

MIS
Oct 13, 2006
66
0
0
US
Dear, I have 2 folders, one called DBDaccess and the other call BLS.

Within each folder are a bunch of classes, for instance,

Namespace BLS
Public Class A

Public Function A ()
--
end function
public function B ()
---
End function
ENd Class
There about 4 classes and each applies also to DBDaccess.

Now, BLS refrences DBDaccess.dll and the userInterface folder references BLS.dll.

So far, despite the fact these dlls are referenced, I either get an error that the dlls are not found or I get an error that the functions contained within them need to be declared.

I must be doing something wrong.

Out of desparation, I copied all the functions inside the UserInterface folder.
The now look like this:
NameSpace UserInterface

Page_load () event

Then the functions from BLS and DBAcess folders follow thus:

Public Class A
Public Function A()
--
End function

Public Function B()
--
End Function

Public Function C ()
--

End function

End Class 'end NamesPace BLS

End Class 'End UserInterface Namespace

Here are my questions,

Why am I having problem referencing these DLLs?

2, Is it possible to nest Public classesses?

In other words, is it possible to use Public Class within another class?
Thanks in advance
 
Are all of these files in a "website project"? There's some funky compiler garbage that may require you to keep all of your code files in the App_Code folder if so.

Alternately you can use a "web application project" or a different project for your class files.

You may also want to check that you're importing the class' namespace(s) so that your code can use those classes.

Furthermore, yes, you can reference and use one class from within another. That's the whole point of organizing code into classes: so you have a reusable abstraction of certain functionality.

MCP, MCTS - .NET Framework 2.0 Web Applications
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top