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

📄 special.ascx

📁 This is a book about vb.you could learn this from this book
💻 ASCX
字号:
<%@ Control Inherits="IBuyAdventure.ControlBase" src="../components/stdctrl.vb" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Configuration" %>

<script language="VB" runat="server">

  Sub Page_Load(sender As Object, e As EventArgs)

    ' Obtain today's special product.  

    Dim inventory As New IBuyAdventure.ProductsDB(getConnStr())
    Dim specialOffer As String

    specialOffer = ConfigurationSettings.AppSettings("specialOffer")
    Dim specialDetails As DataSet = inventory.GetProduct(specialOffer)
         
    ' Update UI with product details
         
    ProductImageURL.Src = Context.Request.ApplicationPath & "/images/" & specialDetails.Tables(0).Rows(0)("ProductImageURL")
    ProductName.Text = specialDetails.Tables(0).Rows(0)("ProductName")
    ProductDescription.Text = specialDetails.Tables(0).Rows(0)("ProductDescription")
    ProductCode.Text = specialDetails.Tables(0).Rows(0)("ProductCode")
    UnitPrice.Text = String.Format("{0:C}", specialDetails.Tables(0).Rows(0)("UnitPrice"))
    OrderAnchor.HRef = Request.ApplicationPath & "/ShoppingCart.aspx?ProductCode=" & specialDetails.Tables(0).Rows(0)("ProductCode")

    If specialDetails.Tables(0).Rows(0)("OnSale") = 0 Then
        sale.Visible = false
    End If
  
  End Sub

</script>

<table width=400 align=center border=1 cellpadding=0 cellspacing=0>
             
  <tr bgcolor="#F7EFDE">
    <td>
      <font face="verdana" size=2 ><b> &nbsp;Today's Special! </b></font>
    </td>
  </tr>
             
  <tr>
    <td>
      <table>
        <tr>
          <td align=left valign=top width=110>
            &nbsp;<IMG id="ProductImageURL" runat="server">
          </td>

          <td align=left valign=top>
                      
            <FONT SIZE=2>
                        
              <B>
                <asp:label id="ProductName" runat="server"/>
              </B>,
              
              <asp:label id="ProductDescription" runat="server"/><BR>

              <BR>
                          
              <table>
                 <tr>
                    <td>            
                      <FONT SIZE=2>    
                        Product Code: <asp:label id="ProductCode" runat="server"/>

                        <BR>

                        Price: <B><asp:label id="UnitPrice" runat="server"/></B>
                      </FONT>
                    </td>
                    
                    <td>
                      &nbsp;&nbsp;
                      <img src="../images/saleTag1.gif" id="sale" runat="server" >
                    </td>
                </tr>
              </table>
                          
              <br>
                          
              <A id="OrderAnchor" HREF='../ShoppingCart.aspx?ProductCode=AW109-15' runat="server">
                <IMG SRC="images/order.gif" WIDTH="55" HEIGHT="15" ALT="Order" BORDER=0>  
              </A>
              
              <br><br>           
                          
            </FONT>       
                                       
          </td>  
        </tr>
      </table>
    </td> 
  </tr>
</table>

⌨️ 快捷键说明

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