Karthik K

Karthik K

  • 1k
  • 738
  • 192.4k

want to clear the cartlist in asp.net ?..

Dec 12 2017 12:39 AM
Hi all ,
 
I want to clear the carlist , which I loaded from the order page. Those values to be generated from temporary datatable. I have confirmed it in Cofirm.aspx Page, I have created Session for that tempory table.
 
After saving the Cartlist. I have clear that Session.
 
I share my code ..Anybody know it ., Suggest me to do so .
  1. protected void Page_Load(object sender, EventArgs e)  
  2. {  
  3. DishCart_DataTable = new DataTable();  
  4. DishCart_DataTable.Columns.Add("DishId");  
  5. DishCart_DataTable.Columns.Add("ImagePath");  
  6. DishCart_DataTable.Columns.Add("DishName");  
  7. DishCart_DataTable.Columns.Add("Price");  
  8. DishCart_DataTable.Columns.Add("Count");  
  9. DishCart_DataTable.Columns.Add("Total");  
  10. DishCart_DataTable = (DataTable)Session["DishCart"];  
  11. grdCart.DataSource = DishCart_DataTable;  
  12. grdCart.DataBind();  
  13. if (!IsPostBack)  
  14. {  
  15. LoadNum();  
  16. }  
This how I load the Grid ., Now i need it to be clear after saving it to database. How can I null session of datatable values.

Answers (6)