首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

前台调用后盾

2012-11-08 
前台调用后台DataTable dt DataBase.Base_dt(select code,wtmc from TB_WTB where WTLX正常)DataT

前台调用后台
DataTable dt = DataBase.Base_dt("select code,wtmc from TB_WTB where WTLX='正常'");
DataTable dt1 = DataBase.Base_dt("select * from tb_xxb where code='" + dt.Rows[0][0].ToString() + "'");

<%foreach (System.Data.DataRow dr in dt.Rows)
  {%>
  <tr>
  <td>问&nbsp 题:</td>
  <td align="left"><%=dr["wtmc"] %></td>  
  </tr>
  <tr>
  <%foreach (System.Data.DataRow dr1 in dt1.Rows)
  {%>
  <td colspan="2">
  <input type="radio" name="rad" value="<%=dr1["xxdm"].ToString() %> " /><%=dr1["xxdm"].ToString() %> <%=dr1["xxmc"].ToString() %>  
  </td> 
  <%} %>

  </tr>  
  <%} %>
为什么问题可以绑定,但是下面foreach里的内容没有绑定?

[解决办法]
你用Repeater吧,这样的。。。我看着头大
[解决办法]
用repeater等控件绑定吧
[解决办法]

C# code
  <%                    foreach (com.ctf.wap.webRequest.Entity.Product product in _ProductInfoArray)                    {                %>                <li><a href="goodsDetail.aspx?Barcode=<%=product.Barcode %>">                    <img src="<%=product.Thumb %>" width="85" height="85" alt="<%=product.Title %>" /></a>                    <span>                        <h4>                            <a href="goodsDetail.aspx?Barcode=<%=product.Barcode %>">                                <%=product.Title %></a></h4>                        <p>                            货品编号:<%=product.Barcode %></p>                        <p>                            货品模号:<%=product.MouldNo %></p>                        <p>                            订单编号:<%=product.OrderNo %>                        </p>                    </span><span class="right">                        <p>                            &nbsp;</p>                        <p>                            购买价:<b class="Sred">¥<%=product.PromotionPrice%></b></p>                    </span></li>                <%                    }                %> 

热点排行