Re: custom namespaces



Thanks Juan, but I'm already doing that... - what I need to do is access the
classes in my own custom *namespace* which is essentially in it's own
*standalone* cs (utility) file, and for which I think I must need to compile
it so that the code behind can actually see/find reference to the custom
namespace...
Matt

"Juan T. Llibre" <nomailreplies@xxxxxxxxxxx> wrote in message
news:O%230RwaNpFHA.1464@xxxxxxxxxxxxxxxxxxxxxxx
> Hi, Matt.
>
> Take a look at :
> http://www.asp101.com/articles/john/codebehindnovs/default.asp
>
> If you look at the code in WebForm2.aspx.vb as your codebehind,
> but use the Page statement in WebForm3.aspx, you'll have
> the answer to your question.
>
> In essence, to use code-behind, you can :
>
> 1. use the Visual Studio model
> 2. compile the code-behind to an assembly and reference it in the aspx
> 3. use the Src and Inherits properties :
> <%@ Page Language="vb" AutoEventWireup="false" Src="WebForm2.aspx.vb"
> Inherits="WebForm2"%>
>
> This last one is your answer. Adapt it to your needs.
>
> You will be able to call any class, property or method by using Src,
> just like if you were using an actual assembly.
>
>
>
>
> Juan T. Llibre
> ASP.NET MVP
> http://asp.net.do/foros/
> Foros de ASP.NET en Español
> Ven, y hablemos de ASP.NET...
> ======================
>
> "Matt Jensen" <replytonewsgroups@xxxxxxxxxxxxx> wrote in message
> news:%23atN3JNpFHA.3544@xxxxxxxxxxxxxxxxxxxxxxx
>> Howdy
>> Relatively new to .NET, I'm trying to create custom a namespace for use
>> in creating some utility classes, which I seem to have done OK, however,
>> I'm having a problem trying to use the class with the error the namespace
>> can't be found.
>>
>> I've really got no idea what I'm doing, I'm coding in C# and essentially
>> using notepad, and trying to get my code behind file to use the class in
>> my custom namespace.
>>
>> I'm guessing the problem is that I haven't compiled my namespace into a
>> dll, but I don't have access to the command line compiler on the network
>> PC here which doesn't help, nor Visual Studio.
>>
>> I've been told I somehow need to add a reference to my namespace if I was
>> using Visual Studio, but I don't have it, nor a command line compiler. Is
>> it possible without these?
>>
>> Basically, I'm looking for an article that is entitled "how to create and
>> reference your own namespaces without visual studio".
>> I've tried putting my code behind and .cs file with my namespace in the
>> bin directory to no avail.
>>
>> Any tips greatly appreciated
>> Cheers
>> Matt
>>
>
>


.



Relevant Pages

  • 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: Help on designing a modular ASP.NET architecture
    ... I checked it and there's no way to compile a *UserControl* into a dll and reference it. ... It's definately a way to modularise a WebSite, and you can compile them, and reference and use them across projects. ... I thought of making one ASP.NET-Project inside of the solution and create some projects containing Custom Web Controls. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Old website mix with asp.net 2
    ... I tried to create the new website in VS 2005, then add my new aspx pages, it fine, I can compile and run. ... I want to include the "Employee" namespace in the using clause but the compilar did not find that. ... When you want to use classes defined in an external assembly, you must add a reference to it in your project. ...
    (microsoft.public.dotnet.framework.aspnet)
  • 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)