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

Includes in ASP.NET

I'm a begginer at ASP.NET having developed for several years in ASP and
VBScript.

I am developing a website where I'm componetazing the header, content
section and the footer. Each secion is a different page.

My codes looks like something like this

<%@ Page Language="vb" AutoEventWireup="false" Codebehind="default.aspx.vb"
Inherits="LDOL._default" %>
<html>
<!--#include file="header.aspx"-->
default page content here...
<!--#include file="footer.aspx"-->
</html>

My dilema comes when I have different functions in the header.vb page (such
as getting metatags from a db) that cannot be seen because the default.aspx
page looks for the function in the default.vb page instead. It returns an
error "Function not declared". I've tried to find a way where I can have all
my common functions in a centrailzed place (like the global.asax) but have
not been successfull. Am I trying to make ASP.NET do something that was a
shortcoming of ASP? That is what is seems to me...
--
Thank you for your help
--
Thank you for your help
Nov 18 '05 #1
1 1099

Hi Dacuna,

There are much betters way in ASP.NET to achieve the same thing.

What you need is a web user control. There are trillions of tutorials on how
to do this on web. A web user control is a particle of reusable HTML combined
with code-behind. The only difference of the web user control from a normal
page is that first it's reusable and second it does not contain any html
header etc. See it as a part of the body of the main page. Then you can
expose methods on this user control to the main page in a simple way.

Perhaps you also need the following links to start with;

User Controls:

http://msdn.microsoft.com/library/de...ercontrols.asp

and even

Page object model:

http://msdn.microsoft.com/asp.net/us...ctmodel_topic3
Hope this helps,

Ethem

"Dacuna" wrote:
I'm a begginer at ASP.NET having developed for several years in ASP and
VBScript.

I am developing a website where I'm componetazing the header, content
section and the footer. Each secion is a different page.

My codes looks like something like this

<%@ Page Language="vb" AutoEventWireup="false" Codebehind="default.aspx.vb"
Inherits="LDOL._default" %>
<html>
<!--#include file="header.aspx"-->
default page content here...
<!--#include file="footer.aspx"-->
</html>

My dilema comes when I have different functions in the header.vb page (such
as getting metatags from a db) that cannot be seen because the default.aspx
page looks for the function in the default.vb page instead. It returns an
error "Function not declared". I've tried to find a way where I can have all
my common functions in a centrailzed place (like the global.asax) but have
not been successfull. Am I trying to make ASP.NET do something that was a
shortcoming of ASP? That is what is seems to me...
--
Thank you for your help
--
Thank you for your help

Nov 18 '05 #2

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

Similar topics

2
by: Joe Mowry | last post by:
First off, I'm posting this question for a friend that doesn't have access to the news groups. Problem: Using PHP as the base and has several PHP < includes > for various functions, all this...
4
by: Patrick | last post by:
I have an ASP site with about 50 ASP files, all of which are currently including a common "includes.asp" file near the top of the file, responsible for generating the <HEAD/> section of the HTML ...
12
by: tshad | last post by:
I am not sure why I am getting this error: I have the following code I want to run from another include file that holds all my functions. functions.inc...
6
by: William F. Zachmann | last post by:
We've got a project going that involves moving an old web site with a massive dll written in C++ that produces most of the output from a SQL 7.0 data base on NT4 onto IIS on Windows 2003 Server...
3
by: Jeff | last post by:
I have an asp page. Now I know this is sortof OT, but I am not sure of the forum to get an answer. I have an include on this asp page <!-- #include file=\forum\includes\consts-inc.asp --> ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.