Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Apr 12, 2012 05:08 PM by dow7
Apr 12, 2012 04:45 PM|LINK
is it possible to select the images without using the <img> tag for a source code like this :
var db = Database.Open("infoabc");
var imgs = db.Query("SELECT * FROM homemedia").ToList();
var featured = imgs[new Random().Next(imgs.Count)];
<img src="@Href("homemedia/" + featured.ImageName)" />
For instance, using a <div class="media"></div> to do it? I'm not sure if the CSS can be dynamic using razor?!
Apr 12, 2012 04:50 PM|LINK
If you give the img an id or css class you can select the img with JQuery
Apr 12, 2012 05:08 PM|LINK
Ok, but i mean without using <img>
ps. solved it by changing the style of html elements.