Re: How Can I Define Global Classes In Web Application ?
- From: "Juan T. Llibre" <nomailreplies@xxxxxxxxxxx>
- Date: Thu, 12 Apr 2007 11:26:36 -0400
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
.
- References:
- How Can I Define Global Classes In Web Application ?
- From: Sylvia A.
- How Can I Define Global Classes In Web Application ?
- Prev by Date: VirtualItemCount in datagrid.
- Next by Date: Getting a control linked to a database record - beginners question
- Previous by thread: Re: How Can I Define Global Classes In Web Application ?
- Next by thread: Re: How Can I Define Global Classes In Web Application ?
- Index(es):
Relevant Pages
|
Loading