I am deleting item from cart through Jquery ajax,but it is not removing. It is returning "System.String[]".
[WebMethod(EnableSession = true)]
public string ClearItem(string Img)
{
try
{
if (Session["Items"] != null)
{
string[] session_item_arr = Session["Items"].ToString().Split('|');
for (int i = 0; i < session_item_arr.Length; i++)
{
string[] key_arr = session_item_arr[i].Split(',');
foreach (string item in key_arr)
{
if (item == Img)
{
session_item_arr = session_item_arr.Where(val => val != session_item_arr[i]).ToArray();
}
}
bool item_inedx = Array.Exists(session_item_arr, x => x == session_item_arr[i]);
if (item_inedx)
{
Session["Items"] = session_item_arr[i];
}
else
{
Session["Items"] = session_item_arr;
}
}
}
}
catch (Exception ex)
{
throw ex;
}
return Session["Items"].ToString();
}