Newbie Question: Share Classes/... between 2 ASP.NET projects in 1 solution

N

Nick Wouters

Dear All

How do I share classes which are build in project "x" so I can use them in
project "y" in ASP.NET
I know how it is done in VB.NET by simple adding a reference to the other
project.
However this seams not to work with ASP.NET projects

Please help

Best Regards

a newbie (Nick - Belgium)
 
K

Kevin Spencer

Hi Nick,

Actually, you can do the same thing in an ASP.Net solution. There are some
classes, such as Page classes and User Controls that this is not possible
for. But classes containing pure business logic and no UI, as well as Server
Controls, which do not have a Template, can certainly be used in multiple
projects.

One problem you may encounter, or have encountered, is how to abtain
references to things like Session and Application State. These can be
accessed from the HttpContext of the current Request. Example:

Dim s As System.Web.SessionState.HttpSessionState =
System.Web.HttpContext.Current.Session

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Sometimes you eat the elephant.
Sometimes the elephant eats you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top