Click here to Skip to main content
15,881,204 members
Articles / Web Development / ASP.NET

Web Application Page Patterns

Rate me:
Please Sign up or sign in to vote.
4.47/5 (4 votes)
23 Jan 200710 min read 47.1K   349   53  
Two common design patterns for web application pages: the Single Entity Postback Editor and the Multi-Entity Postback Editor
<%@ Page Language="C#" AutoEventWireup="true"  EnableViewState="false" CodeFile="OrderEditor.aspx.cs" Inherits="OrderEditor" %>

<!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">
    <title>Order Editor</title>
<link rel="stylesheet" href="sample.css" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <div style="float:right;width:300px;">
    <asp:Label ID="lblResult" runat="server" Text=""></asp:Label>
    </div>

    <h1>Order Editor</h1>
    <a href="Default.aspx">back</a>

    <p>
    This <em>Order Editor</em> page demonstrates both the 
    <strong>Single-Entity Postback Editor</strong> pattern 
    and the more complex varient of the 
    <strong>Multi-Entity Postback Editor</strong> pattern.
    </p>

    <input type="hidden" id="recid" runat="server" />
    <table>
    <tr>
    <th>Customer</th>
    <td>
    <select id="selCustomerId" runat="server">
    </select>
    </td>
    </tr>
    <tr>
    <th>Products</th>
    <td>
    
    <table>
    <tr><th>Product Name</th><th>Price</th><th>Quantity</th></tr>
    <asp:PlaceHolder ID="phProductList" runat="server" />
    </table>
    
    </td>
    </tr>
    </table>
    <input type="submit" value="Save" name="btnAction" />
    </form>
</body>
</html>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Architect Milliman
United States United States
I have been involved in professional software development for over 15 years, focusing on distributed applications on both Microsoft and Java platforms.

I also like long walks on the beach and a sense of humor and don't like mean people Wink | ;-)

Comments and Discussions