⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mymobile.aspx

📁 asp入门到精通的源代码
💻 ASPX
字号:
<%@ Page Language="VB" %>
<%@ Register TagPrefix="Banana" TagName="Header" Src="header.ascx" %>
<%@ Register TagPrefix="Banana" TagName="Menu" Src="menu.ascx" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>

<script runat="server">
   Sub Page_Load(obj As Object, e As EventArgs)
      dim intUserID as Integer = Session("UserID")
      dim objBM as new BananaMobile.BananaMobile
      
      lblSubTotal.Text = objBM.GetSubTotal(intUserID)
      
      if lblSubTotal.Text = "0" then
         btPurchase.Visible = False
      end if
      
      ' Populate List with Category Products
      Dim objReader As OleDbDataReader = objBM.ViewMobile(intUserID)
      dlItems.DataSource = objReader
      dlItems.DataBind()
      objReader.Close()
      objBM.Dispose
   End Sub
   
   Sub BuyIt(obj As Object, e As EventArgs)
      dim objBM as new BananaMobile.BananaMobile
      
      objBM.Purchase(Session("UserID"))
      
      Response.Redirect("thanks.aspx")
   End Sub   
</script>

<html><body background="images/banana_bg.gif">
   <table height="100%" cellspacing=0 cellpadding=0 width="100%">
      <Banana:Header runat="server"/>
      <tr height="100%">
         <Banana:Menu runat="server"/>
            
         <td align=left valign="top" width=100% nowrap>
            <table height="100%" valign="top" align="left" cellspacing=0 cellpadding=0 width="100%">
               <tr height="100%" valign="top">
                  <td nowrap>
                     <table cellspacing=0 cellpadding=0 width="100%">
                        <tr>
                           <td valign="top">
                              &nbsp;<br>
                              <b>Your BananaMobile:</b><p>
                              <asp:DataList id="dlItems" runat="server" Width="100%">
                                 <ItemTemplate>
                                    <table width="100%">
                                       <tr>
                                          <td width="25%">
                                             <%# Container.DataItem("Category") %>
                                          </td>
                                          <td width="25%">
                                             <%# Container.DataItem("Name") %>
                                          </td>
                                          <td width="25%">                     
                                             <b>Price: </b><%# System.String.Format("{0:c}", Container.DataItem("Price")) %>
                                          </td>
                                          <td width="25%">
                                             <a href="RemoveItem.aspx?PartID=<%# Container.DataItem("PartID") %>&cat=<%# Container.DataItem("Category") %>">Remove</a>
                                          </td>
                                       </tr>
                                    </table>
                                 </ItemTemplate>
                              </asp:DataList>
                              <br>
                              <form runat="server">
                                 <b>SubTotal: $<asp:Label id="lblSubTotal" runat="server"/></b>
                                 <p>
                                 <center>
                                 <asp:Button id="btPurchase" runat="server"
                                    Text="Buy It!"
                                    OnClick="BuyIt"/>
                                 </center>
                              </form>
                           </td>
                        </tr>
                     </table>
                 </td>
              </tr>
           </table>
        </td>
     </tr>
  </table>
</body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -