Implement the page for listing all section contents.
We use this page to display all contents of an audio-video section. We have create minimum a skin and the control class to control the skin.
Skin:
\Communities\Common\Themes\Default\Skins\ContentSkins \AudioVideos_AudioVideoSection.ascx
Control class : The "AudioVideoSection" class , which is derived from the "ContentListPage" class, acts as code-behind for this particular skin. (see figure 6). Note that we have initialized the inherited attributes _skinFileName and _getContentItems. From now, the " ContentListPage" class and its ancestor "SkinnedCommunityControle" class will take over most burden jobs such like populating ContentListPage.
ContentList from us. We must only reuse or create custom controls which can be embedded as ItemTemplate in the "ContentList" instance.
- namespace ASPNET.StarterKit.Communities.AudioVideos
- {
- using System;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- using ASPNET.StarterKit.Communities;
- //*********************************************************************
- //
- // AudioVideoSection Class
- //
- // Represents the default page for the Audio-Video section. This class
- // displays a list of audio video listings.
- //
- // _skinFileName = the name of the skin to use for this section
- //
- // _getContentItems = the name of the method that retrieves the list of content items
- //
- //*********************************************************************
- public class AudioVideoSection : ContentListPage
- {
- string _skinFileName = "AudioVideos_AudioVideoSection.ascx";
- GetContentItemsDelegate _getContentItems = new GetContentItemsDelegate
- AudioVideoUtility.GetAllAudioVideos);
- //*********************************************************************
- //
- // AudioVideoSection Constructor
- //
- // Assigns skin and contentItems method to base ContentListPage class
- //
- //*********************************************************************
- public AudioVideoSection() : base()
- {
- SkinFileName = _skinFileName;
- GetContentItems = _getContentItems;
- }
- }
- }
We have created "ItemAVTitle" class to represent the title of an Audio-Video content. It will display the title of a particular content and a image link to represent the type of the content(Audio or Video).
Join the conversation! Your thoughts help the community grow.