Welcome Guest Log in
   The topic address is: http://callbackpage.softain.com/Help/UserControlHolder/UserControlHolder.aspx   Send to a friend
SoftAIN class library
UserControlHolder class
See also  Members
Collapse all  
 
It serves for user controls management.

Namespace: SoftAIN
Assembly:CallbackPage.dll

CollapseSyntax

CollapseОписание

As you know from the recommendations of applications development using the CallbackPage technology, a site has only one main page. All the site information is on user controls, which are loaded as needed. The UserControlHolder class provides a common approach to solve this task. The ControlAliases collection contains a list of user controls. With the help of the SetCurrentControl method you can set the current user control. To find out the name of the chosen control you can use the CurrentControl property or the HolderCurrentControl method. You can have access to that control with the help of the CurrentUserControl property.

Apart from the functionality of a necessary user control loading, the UserControlHolder class also implements the PathHolder.IPathInfo and PathHolder.ISiteMapInfo interfaces. In case you do not need the implementation of these two interfaces, you can set the PathInfo and SiteMapInfo properties to False, respectively. If the interfaces need implementing, you can have the current path information displayed with the help of the FriendlyName property, in easy-to-read form.

As mentioned in the PathHolder class description, the UserControlHolder class takes part in support of site functionality when it works with static links. The PathHolder class parses the address and creates a collection of parameters. The UserControlHolder class controls refer to this collection when it is loaded calling the GetLoadParameter() method, sending to it the value of its ID property as name. If a parameter with such a name exists and its value coincides with the AliasName property of one of the ControlAliases collection objects, this value is assigned to the CurrentControl property and then a corresponding user control is loaded.

CollapseExample

<div id="MainDiv" runat=server>
    <CallbackPage:UserControlHolder ID="Default" CurrentControl="Home" runat=server>
        <CallbackPage:ControlAlias AliasName="Home" FullName="~/Controls/Welcome/Welcome.ascx" runat=server/>
        <CallbackPage:ControlAlias AliasName="Demo" FullName="~/Controls/Demo/Demo.ascx" runat=server/>
        <CallbackPage:ControlAlias AliasName="Help" FullName="~/Controls/Help/Help.ascx" runat=server/>
        <CallbackPage:ControlAlias AliasName="Download" FullName="~/Controls/Download/Download.ascx" runat=server />
        <CallbackPage:ControlAlias AliasName="Register" FullName="~/Controls/Register/Register.ascx" runat=server />
    </CallbackPage:UserControlHolder>
</div>
                            

CollapseHierarchy

CollapseSee also

Copyright © 2005-2007 SoftAIN