views:

6

answers:

0

I am using the Rating Control in .NET 2010, but can't figure out how to save the value back to the db and, more importantly, how to display the proper amount of stars for a given record from the databse.

Here is my markup:

    <ajaxToolkit:ToolkitScriptManager runat="Server" EnablePartialRendering="true" ID="ScriptManager1" />
<ajaxToolkit:Rating ID="Rating1" runat="server" BehaviorID="RatingBehavior1"
StarCssClass="ratingStar" 
WaitingStarCssClass="savedRatingStar" 
FilledStarCssClass="filledRatingStar" 
EmptyStarCssClass="emptyRatingStar"
ForeColor="Red" Width="150px" 
CurrentRating="0" AutoPostBack="True"
>

And here are my styles:

    <style type="text/css">

/* Rating */.ratingStar

{

font-size: 0pt; 
width: 25px;

height: 25px; 
margin: 0px;

padding: 2px; 
cursor: pointer;

display: block;background-repeat: no-repeat; 
}

.filledRatingStar

{

background-image: url(star_filled.jpg); 
}

.emptyRatingStar

{

background-image: url(star.jpg); 
}

.savedRatingStar

{

background-image: url(saved_star.jpg); 
}

</style> 

related questions