Re: common custom classes

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: John M Deal (johndeal_at_necessitysoftware.com)
Date: 12/05/04


Date: Sun, 05 Dec 2004 09:03:04 -0800

If the file containing the common classes is in the same project but has
a different namespace you can simply put a using (C#) or Imports(VB.Net)
statement at the top of the code behind class:

using The.Other.Namespace; //This is for C#

or

Imports The.Other.Namespace 'This is for VB.Net

If the file containing the other classes is in another project/assembly,
you'll also need to set a reference to the DLL that contains the class.
Hope that helps.

Have A Better One!

John M Deal, MCP
Necessity Software

Tony wrote:
> I have created a few pages in asp.net with in line code and have decided
> to convert them to use code behind pages. I have some classes that are
> common to more than one page. How do I add a namespace to my code behind,
> so I can have one file with my code behind that includes a reference to a
> file with my common classes in it?
>
> Thanks
>
> Tony



Relevant Pages

  • common custom classes
    ... How do I add a namespace to my code behind, ... so I can have one file with my code behind that includes a reference to a ... file with my common classes in it? ... Tony ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: common custom classes
    ... > you'll also need to set a reference to the DLL that contains the class. ... absolutely need to compile my common classes into a dll or is there a way ... of adding a reference/path to a source file? ...
    (microsoft.public.dotnet.framework.aspnet)