Virtual Includes in ASP.NET

  • Thread starter Thread starter Steve
  • Start date Start date
S

Steve

Hi,

I am a newbie to ASP.NET, and just recently started ASP.
I have several Questions.

1. I am creating a web page with two drop down lists, which draw data
from the database depending on what you select. I need this section to
be used on two different pages. In ASP I created this page separately,
then used a virtual include including the code at the top of the
actual page that was to be used for the site. That way I would not
have to re-code the same info on two separate pages. Is there a way to
do this in ASP.NET, I was thinking of inheriting the web form, and
adding the additional code on a separate page, but I could not find
the control.

2. This just goes to show how little I know. When developing a web
site. Should I keep all the pages in one solution/Project? or should I
create new solution for each page?

3. I also have a dll/class file I created to be used in this site,
would it be better to add a reference to the dll, or to add the .VB
class file into the solution. It seems that both ways work just as
well, but the latter allows modifications to the .VB class as I go.
And finally, in ASP, I know you have to register the dll, before you
can use it. Is this the same for .NET?

Thanks for you help.
Steve
 
Steven,

1. Virtual Include

In ASP.NET, you should use User Controls for this kind of thing.


2. Should you keep all pages in the same project or solution?

The application boundary is specified by the boundary in IIS. You have to
realize that if you place a page in a different project, that page will not
share Session state with the other pages. Typically, you keep all related
pages in the same project.


3. Should you include a reference to a DLL or just include the class file
in your project?

If your class is designed for use just within this project, keeping the
class file within it will be fine. If you have a DLL that you need to
reference, you don't have to register it anywhere. You simply place it in
the bin folder and add a reference.

Hope that helps.

Jim Cheshire, MCSE, MCSD [MSFT]
Developer Support
ASP.NET
(e-mail address removed)

This post is provided as-is with no warranties and confers no rights.

--------------------
 
Back
Top