|
 |
aspx_beginners thread: Templates
Message #1 by "Datatal AB - Gauffin, Jonas" <Jonas@d...> on Wed, 4 Sep 2002 16:46:08 +0200
|
|
Hi
I want to use templates for my asp pages to simplify the layout administration.
In asp i used <!-- #include file="../include/header.html" --> to include the footer- and headertemplate. Are there a better
way in asp.net?
Header example:
<html>
<head>
<title>This is mysite</title>
</head>
<body bla bla>
<table><tr><td> this is a smoooth layout</td></tr><td>
footer example:
</td></tr></table>
</body>
</html>
page example:
<!-- #include file="../include/header.html" -->
ok. this page got my layout<br>
<br>
smoooth!
<!-- #include file="../include/footer.html" -->
Message #2 by "Mark Harwood" <mark@h...> on Wed, 4 Sep 2002 15:58:17 +0100
|
|
Custom controls are designed for this purpose.
Mark Harwood
-----Original Message-----
From: Datatal AB - Gauffin, Jonas [mailto:Jonas@d...]
Sent: 04 September 2002 15:46
To: aspx_beginners
Subject: [aspx_beginners] Templates
Hi
I want to use templates for my asp pages to simplify the layout
administration.
In asp i used <!-- #include file=3D"../include/header.html" --> to
include
the footer- and headertemplate. Are there a better way in asp.net?
Header example:
<html>
<head>
<title>This is mysite</title>
</head>
<body bla bla>
<table><tr><td> this is a smoooth layout</td></tr><td>
footer example:
</td></tr></table>
</body>
</html>
page example:
<!-- #include file=3D"../include/header.html" -->
ok. this page got my layout<br>
<br>
smoooth!
<!-- #include file=3D"../include/footer.html" -->
---
Beginning ASP.NET Databases using VB.NET
http://www.wrox.com/ACON11.asp?ISBN=3D1861006195
Beginning ASP.NET Databases using C#
http://www.wrox.com/ACON11.asp?ISBN=3D1861007418
These books look at how we can create data-centric ASP.NET
applications. Requiring some basic knowledge of ASP.NET,
Access and SQL the authors guide you through the process
of connecting and consuming information in a variety of
ways. They are packed full of excellent illustrative code
examples, demonstrating important fundamental principles.
Message #3 by "Farrell, Timothy" <Timothy.Farrell@C...> on Wed, 4 Sep 2002 11:06:58 -0400
|
|
Jonas,
.Net uses a control to handle this functionality. Simply create your header
and footer files much the way you would in html, just assign an extension of
*.ascx. Then you can include this control in any page in your website. To
do this you need to reference your control in the *.aspx page.
Here is an example:
You header page:(SimpleHeader.aspx)
<html>
<head>
<title>Your Fantastic Website</title>
</head>
<body>
<h2>Global Super Company</h2>
<i>We Mean Business</i>
<hr>
Your Homepage:(Homepage.aspx)
<%@ Register TagPrefix="SuperCompany" TagName="Header"
Src="SimpleHeader.ascx" %>
<SuperCompany:Header ID="ctlHeader" Runat="server" />
The Page above uses 3 attributes of the Register directive:
* TagPrefix - The alias to associate with the user control's namespace
* TagName - The alias to associate with the user's control class
* Src - The virtual path to the file containing the user control.
HTH
Tim
-----Original Message-----
From: Datatal AB - Gauffin, Jonas [mailto:Jonas@d...]
Sent: Wednesday, September 04, 2002 10:46 AM
To: aspx_beginners
Subject: [aspx_beginners] Templates
Hi
I want to use templates for my asp pages to simplify the layout
administration.
In asp i used <!-- #include file="../include/header.html" --> to include the
footer- and headertemplate. Are there a better way in asp.net?
Header example:
<html>
<head>
<title>This is mysite</title>
</head>
<body bla bla>
<table><tr><td> this is a smoooth layout</td></tr><td>
footer example:
</td></tr></table>
</body>
</html>
page example:
<!-- #include file="../include/header.html" -->
ok. this page got my layout<br>
<br>
smoooth!
<!-- #include file="../include/footer.html" -->
---
Beginning ASP.NET Databases using VB.NET
http://www.wrox.com/ACON11.asp?ISBN=1861006195
Beginning ASP.NET Databases using C#
http://www.wrox.com/ACON11.asp?ISBN=1861007418
These books look at how we can create data-centric ASP.NET
applications. Requiring some basic knowledge of ASP.NET,
Access and SQL the authors guide you through the process
of connecting and consuming information in a variety of
ways. They are packed full of excellent illustrative code
examples, demonstrating important fundamental principles.
The contents of this e-mail are intended for the named addressee only. It
contains information that may be confidential. Unless you are the named
addressee or an authorized designee, you may not copy or use it, or disclose
it to anyone else. If you received it in error please notify us immediately
and then destroy it.
Message #4 by "Stig Skovlind" <skovlind@m...> on Wed, 4 Sep 2002 17:32:17 +0200
|
|
You use this control <body> somewhere inside the body tags<DotNetNews:Top
id="top" runat="server" /> </body>
It refers to this: <%@ Register TagPrefix="DotNetNews" TagName="top"
Src="../controls/top.ascx" %> that resides just beneath your scriptlanguage
declaration- in the top of the head-tag. In the folder /control/ you put
your include-file top.ascx
example:
<%@ Control %>
<table width="100%">
<tr>
<td> <img name="admin_top" src="../controls/Images/admin_top.gif"
width="800" height="50" border="0" usemap="#m_admin_top" alt=""><map
name="m_admin_top">
<area shape="rect" coords="680,20,793,38" href="http://www.avt.dk"
target="_blank" alt="" >
</map></td>
</tr>
</table>
<map name="Map">
<area shape="rect" coords="680,20,793,38" href="http://www.avt.dk"
target="_blank">
</map>
good luck
Stig Skovlind
----- Original Message -----
From: "Datatal AB - Gauffin, Jonas" <Jonas@d...>
To: "aspx_beginners" <aspx_beginners@p...>
Sent: Wednesday, September 04, 2002 4:46 PM
Subject: [aspx_beginners] Templates
> Hi
>
> I want to use templates for my asp pages to simplify the layout
administration.
> In asp i used <!-- #include file="../include/header.html" --> to include
the footer- and headertemplate. Are there a better way in asp.net?
>
> Header example:
> <html>
> <head>
> <title>This is mysite</title>
> </head>
> <body bla bla>
> <table><tr><td> this is a smoooth layout</td></tr><td>
>
> footer example:
> </td></tr></table>
> </body>
> </html>
>
> page example:
> <!-- #include file="../include/header.html" -->
> ok. this page got my layout<br>
> <br>
> smoooth!
> <!-- #include file="../include/footer.html" -->
>
>
>
> ---
> Beginning ASP.NET Databases using VB.NET
> http://www.wrox.com/ACON11.asp?ISBN=1861006195
>
> Beginning ASP.NET Databases using C#
> http://www.wrox.com/ACON11.asp?ISBN=1861007418
>
> These books look at how we can create data-centric ASP.NET
> applications. Requiring some basic knowledge of ASP.NET,
> Access and SQL the authors guide you through the process
> of connecting and consuming information in a variety of
> ways. They are packed full of excellent illustrative code
> examples, demonstrating important fundamental principles.
>
|
|
 |