Overall Template Design in ASP.Net pages and controls

Once you've modified the style sheet and Master Pages, you probably will want to change the content the actual ASP.NET HTML pages. Some pages like default.aspx and Confirmation.aspx probably will need to be custom tailored to your environment. Each of the ASPX pages is used for every theme.

Almost all of the store's UI logic is tied up in the ASPX pages with the exception of the code related to the frame/master page discussed in the Master Page Theme Customization topic.

Here's a typical page again:

The actual page content that the ASPX provides is only for the content area which starts with the My Shopping Cart header and end just above the line above the copyright notice. This topic is defined inside of an ASP.NET Content PlaceHolder in the ASP.NET page:

<%@ Page Language="C#" MasterPageFile="~/App_Templates/Standard/WebStoreMaster.master" AutoEventWireup="true" Inherits="Westwind.WebStore.ShoppingCart" Codefile="ShoppingCart.aspx.cs" %> <asp:Content ID="Content" ContentPlaceHolderID="Content" runat="Server"> ... Page specific HTML and ASPX markup </asp:Content>


The Master Page is actually assigned at runtime depending on which Theme you have selected in the store, so the MasterPageFile tag above is only so that the designer can display the page properly as a Content page.

The actual ASPX markup then only deals with the page specific logic. So in the figure above the ASPX page only handles the display of the shopping cart display which in this case is rendered through a user control.

The ASPX HTML markup pages contain the content that is displayed and you can change this content as you see fit to match your requirements. Both the ASPX markup and the C# code behind can be modified to suit your particular display and business needs.

Most of the UI logic in the ASPX pages is fairly simple and pages do not contain a lot of code, as they defer any business object and data access to the business objects. Most of the code in the ASPX page merely drives the UI with the data provided through the business objects. Therefore understanding and customizing the code is usually pretty straightforward to accomplish.


 Last Updated: 3/3/2007 | Send topic feedback