Being used

In your first website you will have seen that under our copyright statement we put a “using System”. This asks the C# compiler to use the code in the system namespace and make it available to our class.

Class? Namespace? You’ve lost be I hear you say. I’ll go into these things later but for now just think of a class as on lump of code that is related a little bit like a family and think of a namespace as a house where that family lives… actually that's quite a bad analogy, since a namesspace can have multiple families in the same house. Ok think of a namespace as high rise apartment block containing many families. What a rubbish analogy.

All a using statement does is says “I want to use this code in the following block of code. This way you get to use the code and don’t have to rewrite it.

In the .net framework there are hundreds of these namespaces we can use all of them do different things and can make our life easier. As well as using namespaces from the .net framework we can use namespaces that we’ve written in different projects, third party namespaces that you can buy on the Internet or even opensource namespaces that you’ve downloaded from codeplex.

The reason that we used the System namespace in our code is because the page class is in the system namespace. In most instances we will need to use the System namespace as we add to our code we will need to add other namespaces and I’ll point this out along the way.