S
simon
First, I create arrayList and put it into a session.
(should I use arrayList to store different types of data into collection or should I use something else?)
ArrayList arrayValues = new ArrayList();
arrayValues[0] = lstMedia.SelectedValue;// this is int
arrayValues[1] = MediaCalendar.xSelectedDate.Date;//this is datetime
HttpContext.Current.Session["arrayValues"] = arrayValues;
Then, I want to change the value :
HttpContext.Current.session["arrayValues"][0] = 0;
and I get the following error:
Error 47 Cannot apply indexing with [] to an expression of type 'object'
Then I try to convert the object back into arrayList:
(ArrayList)(HttpContext.Current.session["arrayValues"] )[0] = 0;
and still the same error.
Any solution?
Thanks,S
(should I use arrayList to store different types of data into collection or should I use something else?)
ArrayList arrayValues = new ArrayList();
arrayValues[0] = lstMedia.SelectedValue;// this is int
arrayValues[1] = MediaCalendar.xSelectedDate.Date;//this is datetime
HttpContext.Current.Session["arrayValues"] = arrayValues;
Then, I want to change the value :
HttpContext.Current.session["arrayValues"][0] = 0;
and I get the following error:
Error 47 Cannot apply indexing with [] to an expression of type 'object'
Then I try to convert the object back into arrayList:
(ArrayList)(HttpContext.Current.session["arrayValues"] )[0] = 0;
and still the same error.
Any solution?
Thanks,S