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里的内容没有绑定?

解决方案 »

  1.   

    你用Repeater吧,这样的我看着头大
      

  2.   

    <%# %>
    <%= %>
      

  3.   

    这与<%# %>和<%= %>有关系么 第一个里不是也用<%= %> 为什么没关系
      

  4.   


      <%
                        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>
                    <%
                        }
                    %>