后台代码   
public   Coalitions coalitions = new Coalitions();
    CoalitionManager coManager = new CoalitionManager();
    public IList<Coalitions> coList = new List<Coalitions>();    protected void Page_Load(object sender, EventArgs e)
    {
        coList = coManager.GetAllCoalition();
        
    }
前台代码
  <% foreach(Coalitions obj in coList){
         
                         %><li style="width:110px; height:60px; margin-top:4px; float:left; margin-left:5px; border:1px red solid;">
                        
                        <img src="" id="ImgCo" runat="server" alt='<%=obj.CoalitionName %>' /><br />
                        <a href='<%=obj.CoalitionWeb %>' target="_blank" style="text-decoration:none; margin:0 auto;">
                        
                        <%=obj.CoalitionName%></a>
                        <% }%>
                        </li>
 <%=obj.CoalitionName%>已经成功读出想要的信息了,
可是img SRC不知道要如何写,才能读出

解决方案 »

  1.   

    <img src='<%=xxxx%>'/>
      

  2.   

     src='<%=obj.CoalitionPic %>'这样写了,还是没出来,
    界面出来后的图片路径变成了
    http://localhost:4063/Web/<%=obj.CoalitionPic%20%>
      

  3.   

    <%=obj.CoalitionPic %> 有值吗?
      

  4.   

    obj好像在图片路径那是点不出来的,数据库是有值的。
      

  5.   

    http://localhost:4063/Web/<%=obj.CoalitionPic%>显示这个
    要是去掉双引,直接报错。
      

  6.   

    哈问题。解决了。。去掉个runat="server" 就可以了。谢谢帮我想问题的朋友啦