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"/>
精彩评论