I have created sample please check below code.
HTML
OrderFilm.aspx
<div>
<asp:DataList ID="DataList1" runat="server" RepeatColumns="2" RepeatDirection="Horizontal">
<ItemTemplate>
<div>
<asp:Label ID="lbldes" runat="server" Text='<%# Eval("name") %>'></asp:Label>
<asp:HyperLink ID="HyperLink3" runat="server" CssClass="LBP3In" NavigateUrl='<%#"OrderDetails.aspx?ID="+Eval("ID")%>'
Target="_blank">click to order</asp:HyperLink>
</div>
</ItemTemplate>
</asp:DataList>
</div>
OrderDetails.aspx
<div>
<asp:Label ID="lblMessage" runat="server" />
<div>
<asp:Label ID="Lblname" runat="server" Visible="false" />
<br />
<asp:CheckBox ID="cb720P" runat="server" Text="720P " />
<asp:CheckBox ID="cb1080P" runat="server" Text="1080P" />
</div>
<asp:ImageButton ID="Imgorder" runat="server" AlternateText="Place Order" OnClick="Imgorder_Click" />
</div>
<br />
<asp:GridView runat="server" ID="gvOrders" EmptyDataText="No orderPlaced !" ShowFooter="true">
</asp:GridView>
Code
OrderFilm.aspx
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
DataTable dt = new DataTable();
dt.Columns.AddRange(new DataColumn[] { new DataColumn("ID"), new DataColumn("Name"), new DataColumn("720P"),
new DataColumn("1080P"),new DataColumn("720Price"),new DataColumn("1080Price") });
dt.Rows.Add("1", "Spectre.2015", "1", "1", "200$", "300$");
dt.Rows.Add("2", "Water Fall", "1", "1", "150$", "200$");
DataList1.DataSource = dt;
DataList1.DataBind();
}
}
OrderDetails.aspx
protected void Page_Load(object sender, EventArgs e)
{
if (Session["Order"] != null)
{
BindOrder(Session["Order"] as DataTable);
}
}
protected void Imgorder_Click(object sender, ImageClickEventArgs e)
{
int id = Convert.ToInt32(Request.QueryString["ID"]);
DataTable dtFiles = new DataTable();
dtFiles.Columns.AddRange(new DataColumn[] { new DataColumn("ID",typeof(int)), new DataColumn("Name"),
new DataColumn("720P", typeof(int)),new DataColumn("1080P", typeof(int)),
new DataColumn("720Price",typeof(decimal)),new DataColumn("1080Price",typeof(decimal)) });
dtFiles.Rows.Add(1, "Spectre.2015", 1, 1, 200, 300);
dtFiles.Rows.Add(2, "Water Fall", 1, 1, 150, 200);
DataRow name = (from d in dtFiles.AsEnumerable()
where d.Field<int>("ID") == id
select d).FirstOrDefault();
string fileName = (name as DataRow).ItemArray[1].ToString();
string p720 = (name as DataRow).ItemArray[2].ToString();
string p1080 = (name as DataRow).ItemArray[3].ToString();
string price720 = (name as DataRow).ItemArray[4].ToString();
string price1080 = (name as DataRow).ItemArray[5].ToString();
DataTable dt = new DataTable();
if (Session["Order"] != null)
{
dt = Session["Order"] as DataTable;
}
else
{
dt.Columns.AddRange(new DataColumn[] { new DataColumn("Film Name"), new DataColumn("Quality"), new DataColumn("Price", typeof(decimal)), new DataColumn("Quanyity", typeof(int)) });
}
if (cb720P.Checked || cb1080P.Checked)
{
if (cb720P.Checked)
{
dt.Rows.Add(fileName, cb720P.Text.Trim(), price720, p720);
}
if (cb1080P.Checked)
{
dt.Rows.Add(fileName, cb1080P.Text.Trim(), price1080, p1080);
}
Session["Order"] = dt;
}
BindOrder(dt);
}
private void BindOrder(DataTable dt)
{
gvOrders.DataSource = dt;
gvOrders.DataBind();
decimal totalPrice = dt.AsEnumerable().Sum(row => row.Field<decimal>("Price"));
gvOrders.FooterRow.Cells[0].Text = "Total";
gvOrders.FooterRow.Cells[0].HorizontalAlign = HorizontalAlign.Right;
gvOrders.FooterRow.Cells[2].Text = totalPrice.ToString("N2") + "$";
int totalOrder = dt.AsEnumerable().Sum(row => row.Field<int>("Quanyity"));
gvOrders.FooterRow.Cells[3].Text = totalOrder.ToString();
}
Screenshot