473,322 Members | 1,846 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,322 software developers and data experts.

Include Files in ASP.NET

Currently I have a site template using classic asp that uses include files to seperate content from display. How can I do something similar in ASP.NET/C# code behind. Mainly I need to seperate navgation header, side bar and content.

Any tips or techniques would be great.

Thanks, Justin.
Nov 18 '05 #1
3 1331
You can still use <include> tag in ASP.NET or you can build UserControl to do that

Tu-Thac

----- Justin wrote: ----

Currently I have a site template using classic asp that uses include files to seperate content from display. How can I do something similar in ASP.NET/C# code behind. Mainly I need to seperate navgation header, side bar and content

Any tips or techniques would be great

Thanks, Justin.
Nov 18 '05 #2
Justin,
A lot of people use webcontrols to hold the content, such as a
header and footer, and then plop them onto pages as they need. Another
approach is very similar, except then instead of just loading the header and
footer into each and every page, you create a new base page class that
inherits from System.Web.Ui.Page that overrides the render event and loads
these controls for you automatically (inserting header at the beginning and
after the normal page rendering is done it loads and adds the footer
control). You can essentially make it as complicated or simple as you want
with these methods. Using your own header and footer controls is a good
place to start though as it does a very similar job to the SSI includes.

Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage

"Justin" <an*******@discussions.microsoft.com> wrote in message
news:1F**********************************@microsof t.com...
Currently I have a site template using classic asp that uses include files to seperate content from display. How can I do something similar in
ASP.NET/C# code behind. Mainly I need to seperate navgation header, side bar
and content.
Any tips or techniques would be great.

Thanks, Justin.

Nov 18 '05 #3
The most common replacement for old fashioned include files are web user
controls.
They basically are like object oriented include files on steroids.

Here's more info:
http://msdn.microsoft.com/library/de...ercontrols.asp
http://msdn.microsoft.com/library/de...ercontrols.asp
http://msdn.microsoft.com/library/de...ebControls.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com

"Justin" <an*******@discussions.microsoft.com> wrote in message
news:1F**********************************@microsof t.com...
Currently I have a site template using classic asp that uses include files to seperate content from display. How can I do something similar in
ASP.NET/C# code behind. Mainly I need to seperate navgation header, side bar
and content.
Any tips or techniques would be great.

Thanks, Justin.

Nov 18 '05 #4

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

Similar topics

7
by: Chad Scharf | last post by:
I have a legacy ASP application running on IIS 6.0 (Windows Server 2003 Web Edition) that is throwing an error when processesing a certain asp page that has about 200 or so include directives. ...
0
by: Tom Lee | last post by:
Hi, I'm new to .NET 2003 compiler. When I tried to compile my program using DEBUG mode, I got the following errors in the C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7 \include\xdebug...
7
by: mescaline | last post by:
Hi, Suppose a_file.cpp contains a function a_function() Now to include it in main_file.cpp I just do #include "a_file.cpp" and I'm all set. i recently came across this seemingly roundabout...
6
by: atv | last post by:
Alright, i have some questions concerning include files en global variables.I hope someone is willing to answer these. 1).Why is it that if i define a global variable in a file, say main.c, and...
5
by: David Mathog | last post by:
One thing that can make porting C code from one platform to another miserable is #include. In particular, the need to either place the path to an included file within the #include statement or to...
1
by: Minh | last post by:
I've just installed VS.NET 2003 on my Athlon XP 1800+. However I couldn't get any project with STL includes to compile even if I create a new empty project (and added #include <string>). It gave me...
1
by: ya man | last post by:
when i use #include <iostream.h> in some files i get lots of error messages of the kind 'ambiguous symbol this is solved when i use #include <iostream why is that ? and can i use #include...
9
by: chat | last post by:
Hi, every body. I have 3 files like this: -------------------------------------------------------- file name : header.h #ifndef TEST_H #define TEST_H int a=1; double b=0.5;
2
by: key9 | last post by:
Hi all look at the organize tree main.c ------ #include lib_adapter.c main() { foo();
16
by: Chris Shearer Cooper | last post by:
In our Visual Studio 2005 application, we have several of our application's H files that are #included into stdafx.h. What is odd, is that when we change those application H files, VS2005...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.