Click here to Skip to main content
15,119,455 members
Articles / Web Development / ASP.NET
Posted 10 May 2004


28 bookmarked

Microsoft Content Management Server Thumbnail Images Placeholder (C#)

Rate me:
Please Sign up or sign in to vote.
4.44/5 (8 votes)
17 May 20062 min read
An XML placeholder control that displays thumbnails of images in a Resource Gallery.

Sample Image - screenshot.gif


For use in the Microsoft Content Management Server, this is an XML placeholder control that displays thumbnails of images in a Resource Gallery. In authoring mode, the authors specify which Resource Gallery to generate image thumbnails, the thumbnail size, and other sorting and display properties. In presentation mode, all images in the specified Resource Gallery will be rendered as thumbnails with links to the full size images. Practical applications include showing the images of an event, for example.

A VB.NET version of this control is available here.


The placeholder control has the following public properties:

  • SelectGalleryDefaultValue
  • ThumbnailSizeDefaultValue
  • NumColumnsDefaultValue
  • SortByDefaultValue
  • SortOrderDefaultValue
  • RepeatDirectionDefaultValue
  • ShowImageSizeDefaultValue
  • ImageExtensions

All these properties are optional. They allow designers to change the authoring label text and the default values.

The look and feel of the rendered output can be customized by CSS styles. Do a view source on the rendered page to see all the CSS classes available.

Installation Procedures

  1. Please reference the section "Custom Placeholder Controls" in the CMS documentation. It is located in: Site Development: Developing Your MCMS Site: Extending the Functionality of MCMS: Creating Custom Placeholders: Custom Placeholder Controls.
  2. Copy all the files in the directory WebControlLibray to the web control library project of your MCMS solution.
  3. Include the placeholder control in your page template. For example:
    <%@ Register TagPrefix="wcl"
    Assembly=""Web Control Library Assembly Name" %>
    <wcl:ThumbnailImagesPlaceholder id="ThumbnailImagesPlaceholder1"
    runat="server" PlaceholderToBind="ThumbnailImages" 
    ThumbnailSizeDefaultValue="64" SortByDefaultValue="Display Name"
    SortOrderDefaultValue="Ascending" RepeatDirectionDefaultValue="Horizontal"
    ImageExtensions="gif,jpg,png" ShowImageSizeDefaultValue="Yes">
  4. In authoring mode, the client side validation is done by a validation control. In order for it to work, you need to modify some console actions. Copy the action classes to your web control directory. In the console file, register the custom actions and change the default actions to the new custom actions. For example:

    To register a custom action, add:

    <%@ Register TagPrefix="CustomAction"
      Assembly=""Web Control Library Assembly Name" %>


    <CmsConsole:AuthoringSaveNewAction id="AuthoringSaveNewAction1"


    <CustomAction:ValidatedSaveNewAction id="AuthoringSaveNewAction1"

    and, similarly for AuthoringReeditSaveAction and AuthoringReeditSaveAndExitAction.

  5. Include ThumbnailImages.css in the template.
  6. Make sure subscribers have access to the specified Resource Gallery.
  7. Rebuild your site in VS.NET.


  • V1.0 - 2004.05.08 - Base.
  • V1.1 - 2004.07.08
    • Fixed the NullReferenceException when the control is added to an existing template and an existing page using the template is edited.
    • Split CustomAction.cs into individual class files.
  • V1.3 - 2005.04.14 - Revised the public properties and the CSS styles. Added option for Sort Order, Repeat Direction, and Show Image Size. Some changes based on the code submitted by James Penneck. Thanks!
  • V1.4 - 2006.05.14 - Added the ASP.NET 2.0 version.


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Stephen Huen
Software Developer (Senior)
Canada Canada
A Microsoft Certified Professional Developer and Technology Specialist.

Experience and expertise in SharePoint 2016 / 2013 / 2010 / 2007.

Role ranges from a developer in a multi-person team to a solution consultant with expert-level skills, leading a project to completion status.

Proven experience working effectively in a team environment and a self-managed environment.

Comments and Discussions

Questiontemp url but not fixed url, any ideas? Pin
Michael Chao16-Mar-07 11:57
MemberMichael Chao16-Mar-07 11:57 
Answer[Message Removed] Pin
immetoz1-Oct-08 10:45
Memberimmetoz1-Oct-08 10:45 
Generalthumbnail quality Pin
jonathan hall14-Mar-07 13:41
Memberjonathan hall14-Mar-07 13:41 
GeneralRe: thumbnail quality Pin
Stephen Huen15-Mar-07 8:27
MemberStephen Huen15-Mar-07 8:27 
GeneralASP .NET 2.0 Compatibility Pin
istatho12-May-06 7:02
Memberistatho12-May-06 7:02 
GeneralRe: ASP .NET 2.0 Compatibility Pin
Stephen Huen12-May-06 13:27
MemberStephen Huen12-May-06 13:27 
Generalplease help Pin
moshesp7-Feb-05 6:52
Membermoshesp7-Feb-05 6:52 
GeneralRe: please help Pin
Stephen Huen7-Feb-05 8:18
MemberStephen Huen7-Feb-05 8:18 
GeneralRe: please help Pin
moshesp8-Feb-05 0:29
Membermoshesp8-Feb-05 0:29 
GeneralRe: please help Pin
Stephen Huen8-Feb-05 6:16
MemberStephen Huen8-Feb-05 6:16 
GeneralRe: please help Pin
moshesp8-Feb-05 23:45
Membermoshesp8-Feb-05 23:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.