A Simple UpdatePanel's Demo

Database is Northwind.

===========================================================================================

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="RD.aspx.cs" Inherits="Ajax_RD" %>

<!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>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div> 
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
       
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <p>Update Panel 테스트 입니다.</p>
                <p>
                    <asp:GridView ID="GridView1" runat="server" AllowPaging="True"
                        AutoGenerateColumns="False" CellPadding="4" DataSourceID="SqlDataSource1"
                        ForeColor="#333333" GridLines="None">
                        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                        <RowStyle BackColor="#EFF3FB" />
                        <Columns>
                            <asp:BoundField DataField="City" HeaderText="City" SortExpression="City" />
                            <asp:BoundField DataField="CompanyName" HeaderText="CompanyName"
                                SortExpression="CompanyName" />
                            <asp:BoundField DataField="ContactName" HeaderText="ContactName"
                                SortExpression="ContactName" />
                        </Columns>
                        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                        <EditRowStyle BackColor="#2461BF" />
                        <AlternatingRowStyle BackColor="White" />
                    </asp:GridView>
                    <asp:SqlDataSource ID="SqlDataSource1" runat="server"
                        ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
                        SelectCommand="SELECT [City], [CompanyName], [ContactName] FROM [Customer and Suppliers by City]">
                    </asp:SqlDataSource>
                </p>
            </ContentTemplate>           
        </asp:UpdatePanel>
    </div>
    </form>
</body>
</html>

posted @ 2008-12-29 16:41  OOK  阅读(106)  评论(0编辑  收藏  举报