0

I have been trying to make this work and I can't figure out what is wrong with this code. The ajax works great, but I can't display the image.

@Html.Raw(@Ajax.ActionLink("[replacetext]", "_ProductDetail", new
{
  productID = item.ProductsID

},
new AjaxOptions
{
 HttpMethod = "POST",
 UpdateTargetId = "detail",
 LoadingElementId = "loading",
 InsertionMode = InsertionMode.Replace
 })
 .ToHtmlString().Replace("[replacetext]","<img src=\"~/images/tn/@item.Ptn)\" />"))

I also tried <img src=\"~/images/tn/@Html.DisplayFor(modelItem =>item.Ptn)

If I put the hard coded image name, it works fine.

Any ideas? I read some other answers here using helpers but I could not make it work either.

user6272884
  • 101
  • 2
  • 8

0 Answers0