473,395 Members | 1,457 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Virtual Includes in ASP.NET

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
Nov 18 '05 #1
1 1143
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
ja******@online.microsoft.com

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

--------------------
From: st***************@cba.com.au (Steve)
Newsgroups: microsoft.public.dotnet.framework.aspnet
Subject: Virtual Includes in ASP.NET
Date: 18 Nov 2003 16:50:55 -0800
Organization: http://groups.google.com
Lines: 28
Message-ID: <19**************************@posting.google.com >
NNTP-Posting-Host: 140.168.69.166
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 1069203056 9479 127.0.0.1 (19 Nov 2003 00:50:56 GMT)X-Complaints-To: gr**********@google.com
NNTP-Posting-Date: Wed, 19 Nov 2003 00:50:56 +0000 (UTC)
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!news-out.cwix.com!newsfeed.cwix.co
m!newsfeed.icl.net!newsfeed.fjserv.net!colt.net!ne ws.maxwell.syr.edu!postnew
s1.google.com!not-for-mailXref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:191857
X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet

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


Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: jason | last post by:
I am getting twisted by the possibility that my virtual includes which currently work great on non-domain remote IP will crash if I purchase a domain and point it to one of my designated...
13
by: Bryan Harrington | last post by:
Hello all.. I'm working on an application that I'd like to use some shared files. Right now my directory structure is: / (root) .../Shared/ .../Reports/ .../Tools/
3
by: Jim Andersen | last post by:
Hejsa, Har "arvet" et website jeg skal have "oversat" til .NET I øjeblikket er det "almindelige" .asp sider, som jeg ikke har prøvet før. I c:\test\kims\www\eval\default.asp er følgende...
1
by: | ov | last post by:
Hi, My application includes a class library which has both managed C++ and unmanaged C++ code. The unmanaged C++ code includes only one class with both virtual methods and non-virtual methods....
2
by: Edward Diener | last post by:
In C++ an overridden virtual function in a derived class must have the exact same signature of the function which is overridden in the base class, except for the return type which may return a...
8
by: Alex | last post by:
Hi, I have noticed that in an aspx page <!--#include virtual="Home.htm"--> acts the same as <!--#include File="Home.htm"--> when I am NOT in the root diectory of the site (I am aware that...
2
by: WisTex | last post by:
I've come across a very weird problem. Virtual includes work on all my ASP pages on the entire website, including those in subdirectories, yet they won't work on a particular page I created, even...
5
by: druberego | last post by:
I read google and tried to find the solution myself. YES I do know that you can get undefined references if you: a) forget to implement the code for a prototype/header file item, or b) you forget...
3
by: YellowMaple | last post by:
Is it possible to have pure virtual functions defined in a template class? I'm trying to do something like this: template <typename T> class Singleton { public: static T& getInstance(void) {...
2
by: lkrueger | last post by:
Hello-- I have an .html page that I'm trying to use a SSI (footer) and other headers, but it's not showing up. I've tried multiple combinations, but nothing is working. I understand the...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.