I'm just new with asp.net mvc using razor syntax in the view and I would like to know how can I use a model object inside a jQuery routine to set an img src?
For ex:
setSourceImage()
{
@foreach(var myPaths in Model)
{
@: jQuery('#sampleImage').attr('src',myPaths.imgPath)
}
}
I know the syntax is wrong, but in a sense that is what I want to achieve.
Thanks.