当前位置: 代码迷 >> ASP.NET >> repeater 下的ImageButton 显示图片有关问题,知道是路径,但怎样检查都没错
  详细解决方案

repeater 下的ImageButton 显示图片有关问题,知道是路径,但怎样检查都没错

热度:7923   发布时间:2013-02-25 00:00:00.0
repeater 下的ImageButton 显示图片问题,知道是路径,但怎样检查都没错啊
HTML code
 <asp:ImageButton ID="imgBtnPic" runat="server" width="100%" border="0" ImageUrl='~/images/248/<%#Eval("picid")%>.png' CommandName="imgBtnPic" CommandArgument='<%#Eval("ID") %>' />

怎样也想不明为什么显示不了,当然第一反应是路径问题,首先说下images 和 网页的位置吧,他们是放在同一级里面的,
而images又有一个248的文件夹,路径无疑是对的,但就是显示不了,别给我说以248文件夹命名不对呀?!!

C# code
 protected void InitNotimeBreakfast()    {              DataSet ds_breakfastclass = bll_menu.GetMenuByRecom("1");        if (ds_breakfastclass != null && ds_breakfastclass.Tables.Count > 0 && ds_breakfastclass.Tables[0].Rows.Count > 0)        {            Repeater2.DataSource = ds_breakfastclass;            Repeater2.DataBind();        }    }


------解决方案--------------------------------------------------------
写的有问题,这样

C# code
ImageUrl='<%# Eval("picid", "~/images/248/{0}.png") %>'
  相关解决方案