Re: Old website mix with asp.net 2



Hi,

Alan T wrote:
This is my exact question:

I tried to create the new website in VS 2005, then add my new aspx pages, it fine, I can compile and run.
The next question comes up, when I implement my C# class, eg. the namespace is Employee.
In the code-behind, I want to include the "Employee" namespace in the using clause but the compilar did not find that.

Did you include a reference to the DLL containing the Employee namespace? The "using" directive is not doing that, it's merely a scope information, avoiding that you have to write fully qualified names all the time. When you want to use classes defined in an external assembly, you must add a reference to it in your project. To do this, right-click on the "References" folder in Visual Studio's solution explorer.

HTH,
Laurent
--
Laurent Bugnion [MVP ASP.NET]
Software engineering, Blog: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
.



Relevant Pages

  • Re: custom namespaces
    ... and for which I think I must need to compile ... it so that the code behind can actually see/find reference to the custom ... I'm trying to create custom a namespace for use ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Where is System.Collections when using csc.exe
    ... Namespaces are not required to have their types completely contained within an assembly, so asking where the types for a namespace are located doesn't make much sense. ... By default, csc should make a reference to mscorlib.dll automatically, so it seems like it should work to me. ... If you compile this from the command line yourself, ... Visual Studio C# Express 2005 doesn't have a problem with them though, and can compile my code without errors. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Creating a custom class/Namespace
    ... >> How then would I reference this in a new Web Application ... To compile a single source code file, ... If you need to reference a .Net Framework assembly or assemblies, ... I get the message in the compiler output that my namespace ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Creating a custom class/Namespace
    ... Namespace ByteArray ... I then compile it using: ... >>> How then would I reference this in a new Web Application ... > If you need to reference a .Net Framework assembly or assemblies, ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Ambiguous in the Namespace
    ... use the full namespace path when you reference "Employee" ... If your namespace in foo.dll is MyNameSpace.Foo.Employee, ... The ambigous error message is often displayed when it doesnt know which ... "Employee" you are referencing in your code. ...
    (microsoft.public.dotnet.languages.vb)

Loading