\[code\] System.InvalidCastException: [A]System.Collections.Generic.List`1[UploadImages] cannot be cast to System.Collections.Generic.List`1[UploadImages]. if (ViewState["CurrentList"] != null) { ObjUpload.AddRange((List<UploadImages>)ViewState["CurrentList"]); // Getting the above error }\[/code\]UploadImages ObjUp = new UploadImages();\[code\] List<UploadImages> ObjUpload = new List<UploadImages>(); ObjUp.AlternateText = TxtAlternatetext.Text; if (TxtFre.Text != "") { ObjUp.frequency = Convert.ToInt16(TxtFre.Text); } ObjUp.ImageURL = FileUpload1.PostedFile.FileName; ObjUp.URL = TxtUrlToNavigate.Text; ObjUp.ID = i; ObjUpload.Add(ObjUp);\[/code\]I have made my class [Serializable]This code works sometimes but doesn't work sometimes