Click here to Skip to main content
15,891,745 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
I need to Rotate all the image about 25 images from left to right (or right to left) using Datalist , but the problem is that when i run the page, datalist get the automatic width for all 25 images, i set with 400px but its not working, anyone please suggest where i m wrong, source and code below:

plz note i get path from XML file
ASP.NET
<marquee id="marq" behavior="scroll" direction="Horizontal" scrolldelay="4" scrollamount="3">
<asp:DataList ID="DataList2" runat="server" RepeatDirection="Horizontal" Width = "400px">
 <itemtemplate>
<asp:Image ID="TopSchImg" runat="server" Height ="100" Width ="100" ImageUrl ='<%#Eval("Imagepath") %>' />
 </itemtemplate>
  
 </marquee>

CODE:
C#
Dataset dsimg = new DataSet();
dsimg.ReadXml(Server.MapPath("~\\XML\\IT-Awards.xml"));
DataList2.DataSource = dsimg.Tables[0];
DataList2.DataBind();
Posted
Updated 25-Aug-12 2:05am
v2

1 solution

This seems broken to me. Why not use a repeater so you can better control your layout ? Why use a datalist when you apparently know you have exactly four images to bind to ? Why not just use four image tags ? Better yet, fix your design so that it will work if you add a 5th image.
 
Share this answer
 
Comments
AmitGajjar 25-Aug-12 8:06am    
Correct 5+
Member 8699743 25-Aug-12 8:26am    
Thanks, it will work with repeater.....
AmitGajjar 25-Aug-12 8:07am    
i think repeater is the best option for this functionality.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900