Posted by david on 31. January 2009 21:21
“A well-designed web application written for ASP.NET will include separate components that may be organized into distinct data and business tiers. Once you’ve created these components, you can use them from any ASP.NET web page seamlessly.” (1) ( i really need to figure out how to cite book in blogs )
2 ways
Create a new .cs file in the App_Code subdirectory
Create a new class library project ( inside or outside your solution, as mentioned in the last post)
Don’t use the first unless the component is tightly coupled to the app … if you have any intention of reusing the code, stick it in a library.
Macdonald’s explanation of all this, in Pro ASP.NET 3.5, is really, really clear. The example code is nice, too.
1. Macdonald Pro, chap5