首页 新闻 会员 周边 捐助

asp.net//js 在线等.....

0
悬赏园豆:30 [已关闭问题] 关闭于 2015-01-08 11:30

各位大神,谁帮小弟看看这是个啥错,调用后台的头部轮换图片啥也没有,真是咋回事。。。

这是后台页面

{
    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>

webfrom的主页 webfrom | 初学一级 | 园豆:84
提问于:2015-01-08 10:14
< >
分享
所有回答(2)
0

F12

幻天芒 | 园豆:37207 (高人七级) | 2015-01-08 10:20
0

我都东西写错了。。。。谢谢大家了

webfrom | 园豆:84 (初学一级) | 2015-01-08 11:29
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册