Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Includes in ASP.NET

Reply
Thread Tools

Includes in ASP.NET

 
 
=?Utf-8?B?RGFjdW5h?=
Guest
Posts: n/a
 
      10-19-2004
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
 
Reply With Quote
 
 
 
 
=?Utf-8?B?RXRoZW0gQXp1bg==?=
Guest
Posts: n/a
 
      10-19-2004

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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
WiFi Hotspot Directory now includes over 12,000 sites including Intl site! Riverwalk Mobile Wireless Networking 0 09-16-2004 02:45 PM
migrating asp to aspl.net: includes? Davݭ ١risson ASP .Net 4 12-30-2003 09:48 PM
Virtual Includes in ASP.NET Steve ASP .Net 1 11-19-2003 06:58 PM
WEBBOT includes and .ASPX Tor Nordahl ASP .Net 0 11-04-2003 09:49 PM
includes in ASP .NET Geraldine ASP .Net 1 10-29-2003 02:06 PM



Advertisments