Click here to Skip to main content
Click here to Skip to main content
Articles » Web Development » ASP.NET » Howto » Downloads
 
Add your own
alternative version
Go to top

Efficient Server-Side View State Persistence

, 8 Aug 2008
Increasing the performance of your ASP.NET website by reducing the download footprint of your pages.
ServerSide_ViewState.zip
ServerSide_ViewState
App_Browsers
PageStateAdapter.browser
App_Code
App_Data
Cache
Global.asax
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ViewStateInCache.aspx.cs" Inherits="ViewStateInCache" %>

<!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>ViewState In Cache</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
        <asp:Button ID="Button1" runat="server" Text="Make New Record" 
            onclick="Button1_Click" />
    </div>
    <div>
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false" onrowdatabound="GridView1_RowDataBound">
            <Columns>
                <asp:TemplateField HeaderText="Time">
                    <ItemTemplate>
                        <asp:Literal ID="Field1" runat="server"></asp:Literal>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Ticks">
                    <ItemTemplate>
                        <asp:Literal ID="Field2" runat="server"></asp:Literal>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Random String">
                    <ItemTemplate>
                        <asp:Literal ID="Field3" runat="server"></asp:Literal>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
    </div>
    <asp:HyperLink ID="hlnkDefault" runat="server" NavigateUrl="~/Default.aspx" Text="Back to Default"></asp:HyperLink>
    </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 Microsoft Public License (Ms-PL)

Share

About the Author

datacop
Team Leader ICAN
United States United States
Jason Monroe is a Project Manager / Architect with the ICAN grant for the Indiana Department of Education. He has been a professional software developer for 13 years, with the last 8 years focusing on Microsoft technologies.

| Advertise | Privacy | Mobile
Web01 | 2.8.140916.1 | Last Updated 8 Aug 2008
Article Copyright 2008 by datacop
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid