Question: I want to loop through three `List<string>`. I'm sending `ajax` request containing 3 parameter as Array.

This is my `WebMethod`.

```
 public string saveEachTask(string imageData, string desc, string tid)
    {
            var imglist = imageData.Split(',').ToList();
            var desclist = desc.Split(',').ToList();
            var idlist = tid.Split(',').ToList();
           // here i want a foreach loop for above three list
            return "Saved Succesfully";
    }

```

**Edit: in loop how can I identity which string is for img, desc and id**

Any Help appreciated.

Answer: 
Use one loop and each iteration process each list.

```
public string saveEachTask(string imageData, string desc, string tid)
{
  var imglist = imageData.Split(',').ToList();
  var desclist = desc.Split(',').ToList();
  var idlist = tid.Split(',').ToList();

  int maxLength = Math.Max(imglist.Count, Math.Max(desclist.Count, idlist.Count));

  for (int i = 0; i < maxLength; ++i)
  {
    string imgItem = (i < imglist.Count ? imglist[i] : null);
    string descItem = (i < desclist.Count ? desclist[i] : null);
    string idItem = (i < idlist.Count ? idlist[i] : null);

    // TODO: Process imgItem, descItem, idItem
  }

  return "Saved Succesfully";
}

```
If you need to handle everything the same way in your loop, you could try:

```
foreach(var s in imglist.Union(desclist.Union(idlist)))
{
    // do something with the string
}

```