各位大神,谁帮小弟看看这是个啥错,调用后台的头部轮换图片啥也没有,真是咋回事。。。
这是后台页面
{
protected string imglist = "";
protected string prices = "";
protected void Page_Load(object sender, EventArgs e)
{
BannerBind();
Bind();
}
/// <summary>
/// 查询头部轮换图片显示
/// </summary>
protected void BannerBind()
{
SQLHelper Ctrl = new SQLHelper();
string sqlstr = "select * from indexbanner order by pid";
DataTable dt = Ctrl.RunSQL_Dt(sqlstr);
StringBuilder imgStr = new StringBuilder();
foreach (DataRow dr in dt.Rows)
{
imgStr.Append("<li><img src=\"../" + dr["url"].ToString() + "\" alt=\"\"></li>");
}
imglist = imgStr.ToString();
}
/// <summary>
/// 显示产品图片
/// </summary>
protected void Bind()
{
SQLHelper Ctr = new SQLHelper();
string sql = "select pid,img,price,guige from product order by pid";
DataTable de = Ctr.RunSQL_Dt(sql);
StringBuilder price = new StringBuilder();
foreach (DataRow dw in de.Rows)
{
//<li><a href="Detail.aspx?pid=20"><img src="images/imag1.jpg" width="400" height="340" /></a> <span>小米500G</span><span>200元</span></li>
price.Append("<li><a href=\"Detail.aspx?pid=" + dw["pid"].ToString() + "\" ><img src='../" + dw["img"].ToString() + "' width='400' height='340' /></a><span>规格:" + dw["guige"].ToString() + "克<br/>价格:" + dw["price"].ToString() + "元</span></li>");
}
prices = price.ToString();
}
前台页面:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="IndexPage.aspx.cs" Inherits="wx_IndexPage" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>j</title>
<link rel="stylesheet" href="css/lrtk.css">
<script src="../js/jquery.min.js"></script>
</head>
<body>
<!-- 代码 开始 -->
<div class="slide_container">
<ul class="rslides" id="slider">
<%=imglist %>
</ul>
</div>
<!-- 代码 结束 -->
<script src="../js/responsiveslides.min.js"></script>
<script src="../js/slide.js"></script>
<div class="sy">
<dl>现货购买</dl>
<ul>
<%=prices %>
</ul>
</div>
</body>
</html>
F12
我都东西写错了。。。。谢谢大家了