This article demonstrates how to use a Rating Control in ASP.Net using Ajax.Note: We are assuming that you have already completed the installation of the Ajax Toolkit as well as have a basic understanding of coding.This article provides a few steps which will be easy to follow.Step 1:Before you can use any of the Ajax Control Toolkit controls in a page, you first need to add a ScriptManager to the page. You can drag the ScriptManager from the Visual Studio Toolbox window onto the page. The ScriptManager is located in the Ajax Control Toolkit tab under the Toolbox.Step 2:Add a Label control to the page, for displaying the selected value.Step 3:Add a Rating control; you can drag the Rating control from the Ajax control toolkit. The page should look like this:<cc1:Rating ID="Rating1" runat="server"><cc1:Rating ID="Rating1" runat="server"></cc1:Rating><asp:Label ID="labelCaption1" runat="server" Text="Selected value: " /><asp:Label ID="labelValue1" runat="server" Text=""></asp:Label>You need to set up the basic attributes of the Rating control. <cc1:Rating ID="Rating1" runat="server" MaxRating="5" CurrentRating="1" CssClass="ratingStar" StarCssClass="ratingItem" WaitingStarCssClass="Saved" FilledStarCssClass="Filled" EmptyStarCssClass="Empty" AutoPostBack="True" OnChanged="Rating1_Changed">
</cc1:Rating>The control provides a selection of five stars; therefore, it is possible to select a rating from 1 to 5. For images we are providing three basic images for displaying the control state that is recognized by the css class:
You need to be a premium member to use this feature. To access it, you'll have to upgrade your membership.
Become a sharper developer and jumpstart your career.
$0
$
. 00
monthly
For Basic members:
$20
For Premium members:
$45
For Elite members: