是这样子的:主页显示所有产品目录(代码如下:)<%foreach (Product p in (IEnumerable)Model)
      { %>
    <ul style=" float:left;list-style:none; text-align:center; color:Yellow;" >
        <li>
         <a href='<%=Url.Action("detials", "home", new {id=p.ProductID })%>'> <img src='<%=string.Format("Home/GetImage/{0}",p.ProductID)%>' alt="<%=Html.Encode(p.ProductName)%>) "
                height="100px" width="100px" style=" border:0px" /></a> </li>
        <li>名称:
            <%=Html.Encode(p.ProductName) %></li>
        <li>价格:
            <%=Html.Encode(p.UnitsOnOrder) %></li>
        <li>是否存货:
            <%=Html.Encode(p.UnitsInStock) %></li>
    </ul>
    
    <%} %>当点击图片 察看详细情况时,跳转到detials页面(代码如下:)<h2>产品详细</h2>
    <ul style=" list-style:none; text-align:left; color:Blue">
    <li><img src='<%=string.Format("home/GetImage/{0}",Model.ProductID)%>'  alt="" height="300" width="300"/></li>
    <li>产品名称:<%=Html.Encode(Model.ProductName)%></li>
    <li>提供地:<%=Html.Encode(Model.images11) %></li>
    <li>价格:<%=Html.Encode(Model.UnitsOnOrder) %></li>
    <li>是否存货:<%=Html.Encode(Model.UnitsInStock) %></li>
    <li>质量级数:<%=Html.Encode(Model.ReorderLevel) %></li>
    </ul>当跳到这个详细页面时,图片就不能显示出来。但是:当在:Global.asax页更改detials为首页时,运行就可以正常显示:这个原因 是为什么呢?GetImage 方法代码如下:
public ActionResult GetImage(int? id)
        {
            Product p = database.Product.Single(pr => pr.ProductID == id);
            MemoryStream imageStrem = new MemoryStream(p.images.ToArray());
            return new MyCompletion_MVC.Code.Helper(imageStrem, "image/jpeg");
        }helper类代码:
namespace MyCompletion_MVC.Code
{
    public class Helper : ActionResult
    {
        private MemoryStream _imageStream;
        private string FileStyle;
        public Helper(MemoryStream imageStream, string fileStyle)
        {
            _imageStream = imageStream;
            FileStyle = fileStyle;
        }        public override void ExecuteResult(ControllerContext context)
        {
            if (context == null)
            {
                new ArgumentException("context is null");
            }
            if (_imageStream == null)
            {
                new ArgumentException(" imageStream is null");
            }
            if (string.IsNullOrEmpty(FileStyle))
            {
                new ArgumentException("FileStyle is null");
            }            HttpResponseBase response = context.HttpContext.Response;
            response.Clear();
            response.Cache.SetCacheability(HttpCacheability.NoCache);
            response.ContentType = FileStyle;
            _imageStream.WriteTo(response.OutputStream);
        }
    }
}恳请高手帮帮小弟。。小弟无尽感激