开发者

Dynamic image loading.

In a Image tag src = path, I want to dynamically load the image by pulling the image name from the d开发者_开发问答atabase. How can I do that?

<img src="../../Content/themes/base/images/pepsi.jpg" height="100" />

I want to be able to write this some thing like this

<img src="../../Content/themes/base/images/" + model.item.name + """ height="100"/>

I am using MVC3 razor.


Have you tried this?

      <img src="../../Content/themes/base/images/@model.item.name" height="100"/>

If not,

      <img src="../../Content/themes/base/images/@(model.item.name)" height="100"/>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜