With asp.net-4.0 I did this:
slideshow.aspx
<div class="wrapCarousel">
<div class="Carousel">
<% foreach(var image in Images) { %>
<div class="placeImages">
<img width="150px" height="150px" src="../Img/<%=image.TnImg%>" alt="<%=image.Name%>" />
<div class="imageText">
<%=image.Name%>
</div>
</div>
<% } %>
</div>
And then Images was in the code behind like this slideshow.aspx.cs:
public class Image
{
public string TnImg { get; set; }
public string Name { get; set; }
public string City { get; set; }
public string RefPlace { get; set; }
public string RefInfo { get; set; }
public string RefInfoDynamic { get; set; }
public Image(string TnImg, string Name, string City, string RefPlace, string RefInfo, string RefInfoDynamic)
{
this.TnImg = TnImg;
this.Name = Name;
this.City = City;
this.RefPlace = RefPlace;
this.RefInfo = RefInfo;
this.RefInfoDynamic = RefInfoDynamic;
}
}
Images.Add(new Image("", "", "", "", "", "");
Now with asp.net-MVC2 I don't have any code behind so I can't access Images like before and some how instead need to pass it to the .aspx file.
How is this done?
Thanks M