熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> .NET編程 >> 正文

ASP.NET項目開發指南:未處理訂單的管理(1)

2013-11-13 12:26:41  來源: .NET編程 

    未處理訂單的管理(

  未處理訂單管理頁面如圖所示

  未處理訂單管理頁面

  未處理訂單管理頁面ST_Admin_orderlistndaspx的主要HTML代碼

  頁面中有一個GridView控件用來顯示未經處理的訂單的訂購數量訂購者訂購時間等信息主要代碼如程序所示

  程序  ST_Admin_orderlistndaspx

    <form id=Form method=post runat=server>

        <FONT face=宋體>

        <!GridView控件>

        <asp:GridView id=GridView runat=server CellPadding=

             BackColor=White BorderWidth=px

            BorderStyle=None BorderColor=#CC

            AutoGenerateColumns=False Width=%

         onrowcancelingedit=GridView_RowCancelingEdit

          onrowdeleting=GridView_RowDeleting

            onrowediting=GridView_RowEditing

         onrowupdating=GridView_RowUpdating>

            <SelectedRowStyle FontBold=True ForeColor=#

                BackColor=#FFCC></SelectedRowStyle>

            <RowStyle ForeColor=# BackColor=White></RowStyle>

            <HeaderStyle FontBold=True ForeColor=#FFFFCC

                BackColor=#></HeaderStyle>

            <FooterStyle ForeColor=#

                BackColor=#FFFFCC></FooterStyle>

            <Columns>

                <asp:BoundField Visible=False DataField=ST_ID

                    ReadOnly=True></asp:BoundField>

                <asp:BoundField DataField=ST_opid ReadOnly=True

                    HeaderText=產品ID></asp:BoundField>

                <asp:BoundField DataField=ST_opnum ReadOnly=True

                    HeaderText=訂購數量></asp:BoundField>

                <asp:BoundField DataField=ST_ouser ReadOnly=True

                    HeaderText=訂購者></asp:BoundField>

                <asp:BoundField DataField=ST_otime ReadOnly=True

                    HeaderText=訂購時間></asp:BoundField>

                <asp:BoundField DataField=ST_isdeal HeaderText=處理>

                    </asp:BoundField>

                <asp:CommandField ShowEditButton=True />

                <asp:ButtonField Text=刪除

                    CommandName=Delete></asp:ButtonField>

            </Columns>

            <PagerSettings Mode=Numeric />

        </asp:GridView>

    </FONT>

    </form>

  【代碼說明】代碼第行的AutoGenerateColumns屬性表示在將數據綁定到GridView控件時是否自動創建列如果其值設置為False那麼綁定數據中有幾列這裡就顯示幾列代碼第~行還是編輯更新取消和刪除事件

       返回目錄ASPNET項目開發指南

       編輯推薦

       ASPNET MVC 框架揭秘

       ASPNET開發寶典

       ASP NET開發培訓視頻教程


From:http://tw.wingwit.com/Article/program/net/201311/15923.html
    推薦文章
    Copyright © 2005-2013 電腦知識網 Computer Knowledge   All rights reserved.