AspNetCore.Docs/aspnet/web-forms/videos/how-do-i/how-do-i-persist-the-state-...

1.6 KiB

title author description ms.author manager ms.date ms.topic ms.assetid ms.technology ms.prod msc.legacyurl msc.type
[How Do I]: Persist the State of a User Control During a Postback | Microsoft Docs rick-anderson In this video Chris Pels shows how to persist the state of one or more objects in a user control. First, a user control is created that represents the abilit... aspnetcontent wpickett 04/02/2009 article d1bca4c6-838c-40f7-87ec-80bb67e483e5 dotnet-webforms .net-framework /web-forms/videos/how-do-i/how-do-i-persist-the-state-of-a-user-control-during-a-postback video

[How Do I]: Persist the State of a User Control During a Postback

by Chris Pels

In this video Chris Pels shows how to persist the state of one or more objects in a user control. First, a user control is created that represents the ability for a user to specify filter criteria for a search. In addition, a companion Filter class is created to store the filter information. Several user interface elements are added to the filter control along with some methods and properties to store the current filter information in the Filter class instance. Next, the user control persistence is implemented using the RegisterRequiresControlState method and associated Save/Restore methods. These methods store the instance of the filter class and its data during page postbacks. Finally, there is a discussion of how to store multiple objects in control state implementation.

▶ Watch video (23 minutes)