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

ASP.NET項目開發指南:網絡書店訂單的發貨和作廢(1)

2022-06-13   來源: .NET編程 

    訂單的發貨和作廢(

  單擊ST_OrderListaspx頁面中任意訂單後的查看按鈕即可進入ST_OrderDetailaspx頁面在此頁面中會列出選中訂單的收貨人收貨人地址及電話等信息

  ST_OrderDetailaspx的主要HTML代碼

  ST_OrderDetailaspx的主要HTML代碼如程序所示

  程序  ST_OrderDetailaspx

    <%@ OutputCache Duration= VaryByParam=* %>

    …

    <form id=form runat=server>

        <table cellpadding= cellspacing= border= width=%>

            <tr>

                <td>收貨人</td>

                <td><asp:Label runat=server

                    ID=lblST_Consignee></asp:Label></td></tr>

            <tr>

                <td>

                    收貨人地址</td>

                <td><asp:Label runat=server

                    ID=lblST_Address></asp:Label></td></tr>

            <tr><td>

                    收貨人電話

            <tr><td>

                    收貨人Email:</td>

                <td><asp:Label runat=server

                    ID=lblEmail></asp:Label></td>

            </tr>

            <tr><td colspan= align=center>

                <asp:Button ID=Button runat=server Text=發貨

                    CssClass=button OnClick=Button_Click />

                <asp:Button CssClass=button

  ID=Button runat=server

                    Text=作廢 OnClick=Button</td>

                <td><asp:Label runat=server

                    ID=lblPhone></asp:Label></td>

            </tr> _Click /></td>

            </tr>

        </table>

    </form>

  【代碼說明】代碼第~行列出了指定ID的訂單詳情在此只用到了一些簡單的Web控件不再闡述

  ST_OrderDetailaspxcs的主要代碼及其解釋

  當頁面加載時會運行Page_Load中的代碼如程序所示

  程序  ST_OrderDetailaspxcs

        protected void Page_Load(object sender EventArgs e)

        {

            //取出訂單ID

            try

            {

                st_orderid = intParse(Request

  QueryString[orderid])

            }

            catch

            {

                return;

            }

            //取得訂單信息並顯示到各控件

            ST_OrderEntity st_entity = st_order

  GetOrderByID(st_orderid)

            lblST_ConsigneeText = st_entityST_Consignee;

            lblST_AddressText = st_entityST_ConsingeeAddress;

            lblPhoneText = st_entityST_ConsingeePhone;

            lblEmailText = st_entityST_ConsingeeEmail;

        }

       返回目錄ASPNET項目開發指南

       編輯推薦

       ASPNET MVC 框架揭秘

       ASPNET開發寶典

       ASP NET開發培訓視頻教程


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