How to add RepeatLayout as Vertical
<asp:DataList ID="DataList1" runat="server" VerticalAlign="Center" RepeatLayout="Table" RepeatDirection="Vertical">
<ItemTemplate>
<div style="border: 2px solid #ccc;">
<asp:Image ID="Image1" ImageUrl='<%#Eval("photo") %>' runat="server" hight='30' Width="200" Visible="true" />
<br />
<b>Vehicle Reg. No.:</b>
<asp:Label ID="Label7" Text='<%# Eval("EMP_ID") %>' runat="server" />
<br />
<b>Speed (km/h):</b>
<asp:Label ID="Label3" Text='<%#Eval("EMP_NAME") %>' runat="server" />
<br />
</ItemTemplate>
</asp:DataList>
namespace astmngtmnt
{
public partial class WebForm1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
this.BindListView();
}
}
private void BindListView()
{
string constr = ConfigurationManager.ConnectionStrings["constr"].ConnectionString;
using (SqlConnection con = new SqlConnection(constr))
{
using (SqlCommand cmd = new SqlCommand())
{
cmd.CommandText = "SELECT * FROM emp where PROJECT_ID='1003 '";
// cmd.CommandText = "SELECT Name,Dates,Images FROM ImageDate WHERE Month(GETDATE()) = month(dates) and Day(GETDATE()) = day(Dates) and year(GETDATE())= year(Dates)";
cmd.Connection = con;
using (SqlDataAdapter sda = new SqlDataAdapter(cmd))
{
DataTable dt = new DataTable();
sda.Fill(dt);
DataList1.DataSource = dt;
DataList1.DataBind();
}
}
}
}
}
}