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

📄 special.ascx

📁 东软内部材料(四)asp等相关的教学案例 
💻 ASCX
字号:
<%@ Control Inherits="IBuyAdventure.ControlBase" src="../components/stdctrl.cs" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Configuration" %>

<script language="C#" runat="server">

  void Page_Load(Object sender, EventArgs e) {

    // Obtain today's special product.  

    IBuyAdventure.ProductsDB inventory = new IBuyAdventure.ProductsDB(getConnStr());
    string specialOffer;

    specialOffer = ConfigurationSettings.AppSettings["specialOffer"];
    DataSet specialDetails = inventory.GetProduct(specialOffer);
         
    // Update UI with product details
         
    ProductImageURL.Src = Context.Request.ApplicationPath + "/images/" + (String) specialDetails.Tables[0].Rows[0]["ProductImageURL"];
    ProductName.Text = (String) specialDetails.Tables[0].Rows[0]["ProductName"];
    ProductDescription.Text = (String) specialDetails.Tables[0].Rows[0]["ProductDescription"];
    ProductCode.Text = (String) 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=" + (String) specialDetails.Tables[0].Rows[0]["ProductCode"];

    if  ( (int) specialDetails.Tables[0].Rows[0]["OnSale"] == 0 ) {
        sale.Visible = false;
        }
  }

</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 + -