This is my rating control in aspx page. When user click the star, i want to update the label3.
<style type="text/css">
.Star {
background-image: url(img/Star.gif);
height: 17px;
width: 17px;
}
.WaitingStar {
background-image: url(img/WaitingStar.gif);
height: 17px;
width: 17px;
}
.FilledStar {
background-image: url(img/FilledStar.gif);
height: 17px;
width: 17px;
}
</style>
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<ajaxToolkit:Rating ID="Rating1" AutoPostBack="true" OnChanged="OnRatingChanged" runat="server"
StarCssClass="Star" WaitingStarCssClass="WaitingStar" EmptyStarCssClass="Star" CurrentRating="2"
FilledStarCssClass="FilledStar">
</ajaxToolkit:Rating>
</ContentTemplate>
</asp:UpdatePanel>
<asp:Label runat="server" ID="label3"></asp:Label>
<asp:Label runat="server" ID="label4" Text="above"></asp:Label>
</div>
I tried out using Rating1.CurrentRating.ToString() but there is nothing on Label3.
protected void OnRatingChanged(object sender, RatingEventArgs e)
{
label3.Text = Rating1.CurrentRating.ToString();
}
Is my code wrong or I can get the value in another way? I'm planning to get the value from backend because later I will add it into my database. Please help. Thank you.