Re: How Can I Define Global Classes In Web Application ?



rea:
How can I define global classes in web application ?

1. You can place source code in the App_Code directory.
Any source files you place there will be compiled.

2. You can compile them yourself and place the generated
assembly/assemblies in the /bin directory.

That protects your source code a bit more.

To compile a single source code file, use :

csc /t:library /out:utils.dll utils.cs

To compile all .cs files in a directory to utils.dll ,
use : csc /t:library /out:utils.dll *.cs

If you need to reference a .Net Framework assembly or assemblies,
add them, separated by slashes :

csc /t:library /r:system.dll /r:system.data.dll /out:utils.dll *.cs

If you're using VB.NET instead of C#,
use vbc and source files ending in .vb
instead of using csc and source files ending in .cs.

The syntax is the same for vb and c#.

Once you have compiled your assembly, place it in the /bin
directory of your application, and import the Namespace :

<%@ Import Namespace="YourNamespace" %>

If you're working strictly with VS.NET, compile your assembly
as described and add a reference to it in your VS.NET project.

That will allow you to use Intellisense and get your
assembly's properties, methods, etc. when coding.

re:
Classes can be set to session variables ?

If you mean to use classes to *set* session variables, yes.




Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Sylvia A." <slyvia@xxxxxxx> wrote in message news:eIIszcQfHHA.1220@xxxxxxxxxxxxxxxxxxxxxxx
How can I define global classes in web application ?

Classes can be set to session variables ?

Thanks




.



Relevant Pages

  • Re: Object files
    ... The followoing line tells make to compile your main.c file into main.o. ... ..c file are source files in human reabable form, ... the client to see your source code you can give them .o files. ...
    (comp.lang.c)
  • Re: Inner Classs
    ... The problem im getting is that one of the source files in the jar has ... then _you_ should compile it first before using it. ... I don't expect seeing any source code in jar files I'm using at ...
    (comp.lang.java.programmer)
  • Re: C++/TCL Need Solution to Compile Error c2784
    ... There's always the "Platform SDK" from MSDN if you need the window.h stuff, ... Since I'm using the Command Prompt rather than the GUI to compile the ... I then tried to compile your source code and I kept getting the same ...
    (comp.lang.tcl)
  • Re: Debugging Newbie Question
    ... The CLR does not understand this source code and so before it ... ASP.NET, however, ASP.NET will compile your page's source code and cache ... the debugger will have IL and x86 created from ... in release mode assemblies. ...
    (microsoft.public.dotnet.faqs)
  • Re: Debugging Newbie Question
    ... The CLR does not understand this source code and so before it ... ASP.NET will compile your page's source code and cache the result ... > does this so that a debugger can attach to the code and allow you to step ... > release mode assemblies. ...
    (microsoft.public.dotnet.faqs)

Loading