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

Advanced ASPX GridView Pagination and Data Entities

Rate me:
Please Sign up or sign in to vote.
4.90/5 (46 votes)
14 Feb 2013CPOL11 min read 220.2K   12.2K   107  
ASP.NET based software system skeleton that uses the ASPX GridView control and advanced pagination for displaying a list of data entities loaded from the database, and the ASP.NET AJAX ModalPopupExtender control for creating new entities or for editing entities from the grid.
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site.master.cs" Inherits="Ra.GridView.Web.SiteMaster" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head runat="server">
    <title></title>
    <link href="~/Styles/Site.css" rel="stylesheet" type="text/css" />
    <asp:ContentPlaceHolder ID="HeadContent" runat="server">
    </asp:ContentPlaceHolder>
</head>
<script type="text/javascript">

    function ResizeWindow() {
        var h1 = window.document.documentElement.clientHeight - 194;
        //
        if (h1 > _tdMainDiv.style.height) {
            _tdMainDiv.style.height = h1;
        }
    }

    window.onload = function () { ResizeWindow(); }
    window.onresize = function () { ResizeWindow(); }

</script>
<body>
    <form runat="server">
    <asp:ScriptManager ID="_mainScriptManager" runat="server">
    </asp:ScriptManager>
    <div class="page">
        <div class="header">
            <div>
                <table width="100%" cellpadding="0" cellspacing="0">
                    <tr>
                        <td align="left" style="width: 50px;">
                            <asp:Image ID="_titleImage" runat="server" ImageUrl="~/Images/Header.png" />
                        </td>
                        <td align="left" class="headerText">
                            <asp:Literal ID="_titleLiteral" runat="server" Text="Ra-GridView" />
                        </td>
                    </tr>
                </table>
            </div>
            <div class="clear hideSkiplink">
                <asp:Menu ID="NavigationMenu" runat="server" CssClass="menu" EnableViewState="false"
                    IncludeStyleBlock="false" Orientation="Horizontal">
                    <Items>
                        <asp:MenuItem NavigateUrl="~/ContactListPage.aspx" Text="Home" />
                        <asp:MenuItem NavigateUrl="~/About.aspx" Text="About" />
                    </Items>
                </asp:Menu>
            </div>
        </div>
        <asp:UpdatePanel ID="_mainUpdatePanel" runat="server" UpdateMode="Conditional" RenderMode="Inline">
            <ContentTemplate>
                <div class="messageHeader">
                    <asp:Label ID="_errorLabel" runat="server" Text="" ForeColor="#FF3300"></asp:Label>
                </div>
                <div class="upperContent">
                    <asp:ContentPlaceHolder ID="UpperContent" runat="server" />
                </div>
                <div class="main">
                    <table border="0" cellpadding="0" cellspacing="0" style="width: 100%; height: 100%;">
                        <tr>
                            <td valign="top">
                                <div id="_tdMainDiv">
                                    <asp:ContentPlaceHolder ID="MainContent" runat="server" />
                                </div>
                            </td>
                        </tr>
                    </table>
                </div>
            </ContentTemplate>
        </asp:UpdatePanel>
        <div class="clear">
        </div>
    </div>
    <div class="footer">
    </div>
    </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, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Romania Romania
I have about 20 years experiences in leading software projects and teams and about 25 years of working experience in software development (SW Developer, SW Lead, SW Architect, SW PM, SW Manager/Group Leader).

Comments and Discussions