Ajax Control Toolkit
Rating Demonstration
How spicy do you like your Thai food?  
Alignment:
Direction:



[No response provided yet]
Rating Description

The Rating control provides an intuitive rating experience that allows users to select the number of stars that represents their rating. The page designer can specify the initial rating, the maximum rating to allow, the alignment and direction of the stars, and custom styles for the different states a star can have. Rating also supports a ClientCallBack event that allows custom code to run after the user has rated something.

Rating Properties

The control above is initialized with this code. The italic properties are optional:

<ajaxToolkit:Rating ID="ThaiRating" runat="server"
    CurrentRating="2"
    MaxRating="5"
    StarCssClass="ratingStar"
    WaitingStarCssClass="savedRatingStar"
    FilledStarCssClass="filledRatingStar"
    EmptyStarCssClass="emptyRatingStar"
    OnChanged="ThaiRating_Changed" /> 
  • AutoPostBack - True to cause a postback on rating item click.
  • CurrentRating - Initial rating value
  • MaxRating - Maximum rating value
  • ReadOnly - Whether or not the rating can be changed
  • StarCssClass - CSS class for a visible star
  • WaitingStarCssClass - CSS class for a star in waiting mode
  • FilledStarCssClass - CSS class for star in filled mode
  • EmptyStarCssClass - CSS class for a star in empty mode
  • RatingAlign - Alignment of the stars (Vertical or Horizontal)
  • RatingDirection - Orientation of the stars (LeftToRightTopToBottom or RightToLeftBottomToTop)
  • OnChanged - ClientCallBack event to fire when the rating is changed
  • Tag - A custom parameter to pass to the ClientCallBack
Copyright © 2006-2013 Microsoft Corporation. All Rights Reserved.