Storing the images in a hidden field
To do this, you must add reference to the assembly System.Web.Extensions in the CoverFlowWidget project. You can find the assembly on .NET tab.
After adding the references, import the following using statement in the CoverFlow.cs file:
Adding a HiddenField control to the template
Use a HiddenField control to store information on the client without the end-user to be able to see it. To add a HiddenField control, open the CoverFlow.ascx template file and insert the following code at the top:
Write down the ID value, because you will use it to access the control from the CoverFlow.cs code file.
Storing the images in the HiddenField control
To store the images in the HiddenField control, perform the following:
- Get an instance of the HiddenField control.
- Set its Value property to the result from the serialization.
Following is the code for the InitializeControls method:
List<Hashtable> images = GetImages();
serializedCollection = serializer.Serialize(images);
.imagesField = container.GetControl<HiddenField>(
.imagesField.Value = serializedCollection;