Beginner - Assemblies and Multiple .cs files

R

Ranginald

Hi,

I have an asp.net project and I am in the process of trying to make it
into a truly object-oriented project -- as I have just learned I cannot
have multiple codebehind files in a single page.

(The big picture is that I have a template file that has methods called
on page_load from a project.cs file and thus each derived template page
is "stuck" with the same codefile directive) Now I need to call
additional methods on these derived pages and I can't use page_load
because it would call it on every page.

So.....

In order to get around this problem I was told to create .dll's (or a
single .dll) and then just point the codefile reference at .dll's.
This way I can use class.method that I need after importing the
namespace and not worry about storing the code in one .cs file (as long
as I override the page_load).

Forgive the basic question but why would someone want to complie
multiple .cs files into one .dll? Do professional programmers create
one class per .cs file?

Thanks!
 
B

Brendan Green

It really depends on the project.
There's nothing wrong with combining a bunch of related classes together
into a single assembly.
 

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

Top