Results 1 to 9 of 9

Thread: namespaces and classes in separate files?

  1. #1

    Thread Starter
    Frenzied Member markman's Avatar
    Join Date
    Nov 2000
    Location
    Florida.
    Posts
    1,197

    namespaces and classes in separate files?

    How can I have a namespace spread across a couple files, each containing a single class? Then one single aspx page would use all the classes when running...
    retired member. Thanks for everything

  2. #2
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    just use the same namespace setup in each file. It is as simple as that.
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  3. #3

    Thread Starter
    Frenzied Member markman's Avatar
    Join Date
    Nov 2000
    Location
    Florida.
    Posts
    1,197
    But if I declare an object of a class thats in a file somewhere else in a subfolder, the framework will just search for a file that declares that class?

    That doesnt seem right....
    Last edited by markman; Nov 1st, 2002 at 10:54 PM.
    retired member. Thanks for everything

  4. #4
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    I dont think I quite understand what yiou mean.

    Maybe Im just sleepy.
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  5. #5

    Thread Starter
    Frenzied Member markman's Avatar
    Join Date
    Nov 2000
    Location
    Florida.
    Posts
    1,197
    Say I had one file that the user views.
    That file would use several classes, each being a separate file. So Class1 would be in file1, etc.
    Each of these classes are in one single namespace.

    This is a very simple question, for a very simple beginner....
    retired member. Thanks for everything

  6. #6
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    I think I understand..hmm well I would assume that you would have to use the CodeBehind declaration at the top of the ASP.NET page for each class..question is, can you do it with more that one file per page..hmm.. May have to look into that Monday.
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  7. #7

    Thread Starter
    Frenzied Member markman's Avatar
    Join Date
    Nov 2000
    Location
    Florida.
    Posts
    1,197
    I cant use CodeBwehind on the server Im on. I have to use Src="..." instead of CodeBehind="..."
    retired member. Thanks for everything

  8. #8

    Thread Starter
    Frenzied Member markman's Avatar
    Join Date
    Nov 2000
    Location
    Florida.
    Posts
    1,197
    retired member. Thanks for everything

  9. #9

    Thread Starter
    Frenzied Member markman's Avatar
    Join Date
    Nov 2000
    Location
    Florida.
    Posts
    1,197
    bumpity bump
    retired member. Thanks for everything

Posting Permissions

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



Click Here to Expand Forum to Full Width