Jag använder mig av ViewState för att lagra en Collection med filnamn. Får inget fel då jag lägger till collectionen till ViewState utan då jag ska använda ViewState tex visa värden från den.
dim filer as new Collection
filer.Add("col", filnamn)
ViewState.Add("fil", filer)
Får detta fel:
Description: An unhandled exception occured during the execution of the web request. Please review the stack trace for more information about the error and where it orginated in the code.
Exception Details: System.Web.HttpException: The type 'Microsoft.VisualBasic.Collection' must be marked as Serializable or have a TypeConverter other than ReferenceConverter to be put in viewstate.
Byter jag ut ViewState till Session funkar det utan problem. Anledningen till att jag vill använda ViewState är att jag bara behöver lagra info under tiden jag är på en sida. Slipper då bry mig om att kasta sessioner.
Är det någon som vet hur jag ska göra för att få det att fungera med ViewState?