How to Use ASP.NET Rating Control

5 04 2008

Following steps are to follow

1. Drop an Ajax rating control on your aspx page.

2. Enable it autopostback value to true.

3. Give the essential attributes like filledstarcssclass, filledRatingStarcssClass etc. (Css is also given here , you can use your own)

<cc1:Rating ID=”Rating1″ runat=”server” CurrentRating=”2″ MaxRating = “5” FilledStarCssClass=”filledRatingStar” WaitingStarCssClass=”savedRatingStar” StarCssClass=”ratingStar” EmptyStarCssClass=”emptyRatingStar” ></cc1:Rating>
.ratingStar
{
font-size: 0pt;
width: 12px;
height: 12px;
cursor:pointer;
background-repeat: no-repeat;
}

.filledRatingStar
{
background-image: url(images/fillStar.png);
}

.emptyRatingStar
{
background-image: url(images/emptyStar.png);
}
.savedRatingStar
{
background-image: url(images/login_form_btn.gif);
}

4. Double click the control in visual studio.NET and write appropriate action which you want for control.