ASNA Mobile RPG® Reference Manual |
Master Pages
ASNA Mobile RPG uses two master page files that define the standard behavior, look and feel for all of the pages in your application. By default the master pages are called MasterPage.master and MasterPage.window.master and both are located in the websitehome\themes\current folder.
Note: Should you choose to rename your Master Pages (or use entirely new ones), it's vital that both have the same name, except that the first must have the file extension ".master" while the second has the file extension ".window.master" (not case-sensitive). Wings automatically searches for the WINDOW property to distinguish standard pages from pop-up windows, using the .window.master file whenever it finds WINDOW, and .master file where it does not. Mismatched file names could cause major formatting or runtime errors.
Similarly, if changes are made to the name of form in one Master Page, the forms in the other must be identical as well. i.e. If MasterPage.master has a form named Form1, then Masterpage.window.master must contain Form1 as well.
MasterPage.master
The ASNA Mobile RPG Monarch Display File agent will use this master page file (MasterPage.master) when displaying ASPX pages. There are several divisions defined within the master page (shown below). One is the division on the left that contains the header (HeaderPH), the logo and an area of function keys (FKeyPH) below the logo. The two table divisions to the right of the header and function keys hold the center content placeholder (CenPH) and a bottom line section for displayed messages (MsgPH); they define more of the page's positioning. This is where the majority of the individual aspx content file will be displayed for the user. A final placeholder section, outside the form, is PageScriptPH for the contents of any scripts that may be needed to execute on the page.
// section for header and function keys
<head>
<asp:ContentPlaceHolder ID="HeaderPH" runat="server" />
</head>
<body>
<form>
<div id="Div1" >
<asp:ContentPlaceHolder ID="FKeyPH" runat="server" />
</div>
// table divisions for main page content and messages
<div id="centralDiv" class="CenPH" >
<asp:ContentPlaceHolder ID="CenPH" runat="server" />
</div>
<div id="msgDiv" >
<asp:ContentPlaceHolder ID="MsgPH" runat="server" />
</div>
// section outside the form for page script
</form>
<asp:ContentPlaceHolder ID="PageScriptPH" runat="server" />
</body>
MasterPage.Window.master
The ASNA Monarch Display File agent will switch to using this master page when it encounters a DDS Record as a WINDOW. This can be specifically useful on pop-up windows to standardize the layout of the content with the defined element placement and coloring controlled by the window.master page.
This file is very similar to the normal master page above. The content placeholders have a different class, but the content placeholder ids are the same as shown below. This allows a content page to be displayed easily by either master page.
The areas that can be changed are similar to the normal master page, except there is no Logo on the window page, and designers have a few further options. The way the Window DdsRecord is displayed is controlled by two factors: properties (found in MasterPage.Window.master and CSS styles found (by default) in ~Themes/Current/Styles/Theme.css. The properties that control it are:
Property | Description |
---|---|
WindowLeft | The X-coordinate of the window's left edge. |
WindowTop | The Y-coordinate of the top of the window. |
WindowWidth | The width of the window. |
WindowHeight | The height of the window. |
WindowTitle | The text for the window's title. |
WindowTitleField | The name of the field containing the text to use as the WindowTitle |
WindowLeftField | The name of the field containing the X-coordinate of the window's left edge. |
WindowTopField | The name of the field containing the Y-coordinate of the window's top. |
And the CSS styles that impact its appearance are:
Style | Description |
---|---|
DdsInlinePopUpBackground | Applied to elements covered by the Window record. |
DdsInlinePopUpTable | Defines the Window record's container element. |
DdsInlinePopUpContent | Defines the area where the Window record fields will be presented. |
DdsInlinePopUpTitle | Defines the title of the Window record. |
Also note that if the WindowTitle property is used, the window can be dragged around the screen just like a standard desktop Window.
MasterPage.Window.master should not contain any "Embedded ASP.NET Code blocks". For a definition of "Embedded ASP.NET Code blocks" see http://msdn.microsoft.com/en-us/library/ms178135.aspx.
If such code blocks exist, when an application tries to open a WINDOW DdsRecord, the following System.Web.HttpException exception will be thrown at runtime: "The Controls collection cannot be modified because the control contains code blocks" The most common control block is the ResolveUrl, for example:
<img src="<%=ResolveUrl("~/images/nav_01.gif")%>">
Fortunately, Window records are usually simple, and do not require too many additional resources (since you want to use these records as clean Popup Windows, on top of your main Record which may already have images and other custom styles). If ASP.NET Code blocks are required in a Window Master Page, use data-binding expressions instead (http://msdn.microsoft.com/en-us/library/ms178366.aspx) and have the code-behind bind the expressions, so that symbols are resolved before the Page gets rendered.
The simplest solution is to include your code blocks in the header, and begin them with <%# rather than <%=, which will mark them as databinding expressions, and then add the following code to the masterpage:
protected void Page_Load(object sender, EventArgs e) { Page.Header.DataBind(); }
- ASNA Monarch Theme Components
- Describes the main framework concepts regarding the components that create a 'theme' for your website: language templates, master pages, and cascading style sheets.