6.10.5广告系统
1)自定义控件实现:
主页产品广告展现:
相关技术:
使用自定义控件 adv_productList.ascx
相关代码:
private void Page_Load(object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面
int[] productID=new int[8];
productID[0]=23;
productID[1]=24;
productID[2]=13;
productID[3]=10;
productID[4]=11;
productID[5]=14;
productID[6]=15;
productID[7]=8;
if(!IsPostBack)
{
productDB PDB =new productDB();
//第一个商品广告
SqlDataReader result=PDB.ProductDetail(productID[0]);
result.Read();
HyperLink1.Text = (String) result["productName"];
HyperLink1.NavigateUrl = "Product\\showDetail.aspx?ProductID="+productID[0];
Image1.ImageUrl = "Product\\ReadImage.aspx?ProductID="+productID[0];
//第二个商品广告
result =PDB.ProductDetail(+productID[1]);
result.Read();
HyperLink2.Text = (String) result["productName"];
HyperLink2.NavigateUrl = "Product\\showDetail.aspx?ProductID="+productID[1];
Image2.ImageUrl = "Product\\ReadImage.aspx?ProductID="+productID[1];
result =PDB.ProductDetail(+productID[2]);
result.Read();
HyperLink3.Text = (String) result["productName"];
HyperLink3.NavigateUrl = "Product\\showDetail.aspx?ProductID="+productID[2];
Image3.ImageUrl = "Product\\ReadImage.aspx?ProductID="+productID[2];
result =PDB.ProductDetail(+productID[3]);
result.Read();
HyperLink4.Text = (String) result["productName"];
HyperLink4.NavigateUrl = "Product\\showDetail.aspx?ProductID="+productID[3];
Image4.ImageUrl = "Product\\ReadImage.aspx?ProductID="+productID[3];
result =PDB.ProductDetail(+productID[4]);
result.Read();
HyperLink5.Text = (String) result["productName"];
HyperLink5.NavigateUrl = "Product\\showDetail.aspx?ProductID="+productID[4];
Image5.ImageUrl = "Product\\ReadImage.aspx?ProductID="+productID[4];
result =PDB.ProductDetail(+productID[5]);
result.Read();
HyperLink6.Text = (String) result["productName"];
HyperLink6.NavigateUrl = "Product\\showDetail.aspx?ProductID="+productID[5];
Image6.ImageUrl = "Product\\ReadImage.aspx?ProductID="+productID[5];
result =PDB.ProductDetail(+productID[6]);
result.Read();
HyperLink7.Text = (String) result["productName"];
HyperLink7.NavigateUrl = "Product\\showDetail.aspx?ProductID="+productID[6];
Image7.ImageUrl = "Product\\ReadImage.aspx?ProductID="+productID[6];
result =PDB.ProductDetail(+productID[7]);
result.Read();
HyperLink8.Text = (String) result["productName"];
HyperLink8.NavigateUrl = "Product\\showDetail.aspx?ProductID="+productID[7];
Image8.ImageUrl = "Product\\ReadImage.aspx?ProductID="+productID[7];
}
<< 上一页 [21] [22] [23] [24] [25] [26] [27] [28] [29] [30] ... 下一页 >>
ASP+SQL SERVER2000电子商城系统 第30页下载如图片无法显示或论文不完整,请联系qq752018766