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

ASP.NET項目開發指南:圖書的顯示(1)

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

    用戶界面

  一般用戶登錄後將進入用戶界面如圖所示

  用戶界面

    圖書的顯示(

  在用戶界面中單擊左邊導航條時將進入ST_ClassProductaspx頁面該頁面主要用來顯示圖書的一些主要信息如圖所示

  圖書展示

  ST_ClassProductaspx的主要HTML代碼

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

  程序  ST_ClassProductaspx

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

    <div align=center>

    <table id=Table height=% cellSpacing= cellPadding=

            width= border=>

        <tr>

            <td vAlign=top width= colSpan=>

                <!頭控件>

                <uc:st_header id=ST_Header

                    runat=server></uc:st_header></td>

        </tr>

        <tr>

            <td vAlign=top width=

  bgColor=#eee height=%

                rowSpan=><uc:st_class id=ST_Class

                runat=server></uc:st_class></td>

            <td style=HEIGHT: % vAlign=top width=>

            <asp:Label Runat=server id=Label ForeColor=Red

                Visible=False>該分類下沒有圖書</asp:Label>

            <!GridView控件>

            <asp:GridView id=GridView Width=% runat=server

                BorderColor=#CCCCCC BorderStyle=None

                BorderWidth=px BackColor=White CellPadding=

                GridLines=Horizontal ForeColor=Black

                AutoGenerateColumns=False AllowPaging=True>

                <SelectedRowStyle FontBold=True ForeColor=White

                    BackColor=#CC></SelectedRowStyle>

                <HeaderStyle FontBold=True ForeColor=White

                    BackColor=#></HeaderStyle>

                <FooterStyle ForeColor=Black

                    BackColor=#CCCC></FooterStyle>

                <Columns>

                    <!模板列>

                    <asp:TemplateField HeaderText=圖片>

                        <ItemTemplate>

                        <img src=<%# imgpath + Eval(ST_Image)%>

                            width= height= />

                        </ItemTemplate>

                    </asp:TemplateField>

                    <asp:TemplateField HeaderText=書名>

                        <ItemTemplate>

                            <a href=<%# ST_

  Productaspx?st_productid= +

                        Eval(ST_ProductID)%>>

                            <%# Eval(ST_ProductName)%>

            </a>

                        </ItemTemplate>

                    </asp:TemplateField>

                <asp:BoundField DataField=ST_Publisher

  HeaderText=出版

                    社></asp:BoundField>

                <asp:BoundField DataField=ST_SoldPrice

  HeaderText=價格>

                    </asp:BoundField>

                <asp:BoundField DataField=ST_Author

  HeaderText=作者>

                    </asp:BoundField>

                <!模板列>

                <asp:TemplateField HeaderText=購買>

                    <ItemTemplate>

                        <a href=<%# ST_AddToCartaspx?st_productid= +

                    Eval(ST_ProductID)%> target=_blank>購買</a>

                    </ItemTemplate>

                </asp:TemplateField>

                <asp:BoundField DataField=ST_ProductID

                    Visible=False></asp:BoundField>

                </Columns>

                <!分頁樣式>

                <PagerSettings Mode=Numeric />

            </asp:GridView></td></tr>

        <tr>

            <td vAlign=top width= height=></td></tr>

        <tr>

            <td vAlign=top width=% colSpan=><uc:st_bottom

                id=ST_Bottom runat=server></uc:st_bottom></td>

        </tr></table>

    </div>

    </form>

       返回目錄ASPNET項目開發指南

       編輯推薦

       ASPNET MVC 框架揭秘

       ASPNET開發寶典

       ASP NET開發培訓視頻教程


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