Implementing Custom Persistence

You can implement customized persistence formats for ASP.NET server controls by using a customized control builder. The MobileControl base class has its own control builder, the MobileControlBuilder class. All control builders implemented for ASP.NET mobile controls must inherit from the MobileControlBuilder class.

To implement custom persistence

  1. Create a control builder class using the following outline:

    namespace MyCompany.MyMobileControls
         * Control builder for my controls
        public class MyControlBuilder : MobileControlBuilder
            // Insert your code here.

  2. Add a ControlBuilder attribute to the control for which you are writing the control builder class:

    public class List : PagedControl,INamingContainer,IListControl,ITemplateable,
    // Add code here.

    ASP.NET uses control builder objects when a page is parsed and compiled.

The following table lists the mobile controls that have specialized control builders. If you create a control to inherit properties from another control and you want to implement custom persistence, you must use a class that inherits the ControlBuilder base class.

Community Additions