In the below code I have a method it throws error while executing
" Cannot implicitly convert type 'object' to 'System.Collections.ArrayList'"
Please help me to do this.
private string strGetIndentString()
{
ArrayList nArr = new ArrayList();
System.Text.StringBuilder strInfo = new System.Text.StringBuilder();
if (Session["CHECKED_ITEMS"] != null)
nArr = Session["CHECKED_ITEMS"];//throws error
for (int i = 0; i < nArr.Count; i++)
strInfo.Append(nArr[i].ToString() + ",");
return strInfo.ToString().TrimEnd(",".ToCharArray());
}
Change your code like this where you are getting value form session
nArr=(ArrayList)Session["CHECKED_ITEMS"];
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments