The types of segments are described below.
inline (default):
This would show in the source content, as shown below:
<!--aws:segment id="actionEqualNew" --> . . . . Code for Create . . . . <!--/aws:segment -->
This would be implemented as show here.
<asp:Panel id="actionEqualNew" runat="server" Visible="<%# Action==’NEW’"> . . . . Code for Create . . . . </asp:Panel>
There are other inline segments like <table>, <td< and <tr<, that do not need annotation, but would be translated to their equivalent Web Controls, whenever there are dynamic specifications associated with them in the segment descriptors.
static-include:
Static include is implemented with the include directive.
<!-- #include file="NavigationButtons.inc" -->
The inc extension of preceding the name with inc_ makes it obvious that a file would be included by others. This is not required; the content might be browsable with the ?inc? extension, it might be thus preferable to use the aspx extension.
The file entry is derived from the value entry of the segment descriptor.
dynamic-include:
Dynamic include, in some sense allows the same facilities as the static-include, except for the fact that the inclusion is done at runtime, rather than at an earlier or deploy time. The file name could also be specified dynamically.
There is no match for this facility on the ASP.NET platform. The suggested avenue for reuse is to build user components, which could be included in any page.
insert-include:
This type of segment is used for template re-use scheme, or the Master page scheme on the ASP.NET platform. From the specification point, ?insert-include? segments are placeholders for segments that could be overridden by client pages using the template.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
</head>
<body>
<!--aws:segment id="CPH1" type="insert-include" -->
<!--/aws:segment -->
</body>
</html>
The implementation of such page would be as follows.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
</head>
<body>
<asp:ContentPlaceHolder id="CPH1" runat="server">
</asp:ContentPlaceHolder>
</body>
</html>
The pages that use this template would specify the page above as a template in the page descriptor. All that is needed is for the page to have a segment (content) with the same id as that of the place holders. It would imply an override of the specific content holder. The code segment below, serves as an example.
<%@ Page MasterPageFile="master1.master" %>
<asp:Content ContentPlaceHolderId="CPH1" runat="server">
<h2>Individual Content</h2>
<p>Paragraph 1</p>
<p>Paragraph 2</p>
</asp:Content>
|