I am developing Canteen Management System where I am displaying menuList from Database using gridview like given below.. ( this is Menu.aspx page)
<asp:DataList ID="DataList1" runat="server" RepeatColumns="3" RepeatDirection="Horizontal" OnItemCommand="DataList1_ItemCommand">
<ItemTemplate>
<table class="nav-justified" style="height: 111px">
<tr>
<td>
<asp:Label ID="Label1" runat="server" Text='<%# Eval("menuName") %>'></asp:Label>
</td>
</tr>
<tr>
<td>
<asp:ImageButton ID="ImageButton1" runat="server" CommandName="viewDetail" CommandArgument='<%# Eval("Id") %>' ImageUrl='<%# Eval("menuImage") %>' />
</td>
</tr>
<tr>
<td>
<asp:Label ID="Label2" runat="server" Text='<%# Eval("menuPrice") %>'></asp:Label>
</td>
</tr>
</table>
</ItemTemplate>
</asp:DataList>
<br />
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:Cms_AspFormsConnectionString %>" SelectCommand="SELECT [menuName], [menuPrice], [menuImage], [Id] FROM [menuInfo]"></asp:SqlDataSource>
This is Menu.aspx.cs page
protected void DataList1_ItemCommand(object source, DataListCommandEventArgs e)
{
if ( e.CommandName == "viewDetail" )
{
Response.Redirect("MenuDetails.aspx?Id=" + e.CommandArgument.ToString());
}
}
but When i run this this it's showing nothing, ( when i go to source page it was all empty at like given below..)
<div>
<br />
</div>
Why it' showing empty? and how to resolve this?