Hi...I'm trying to use the Rating Control in the Ajax Toolkit in a datalist. I have the control showing up in the list, with the logged in users current rating for each item in the list showing...
When a user clicks on one of the rating controls, how would I go about calling a function (passing in the ID parameter from my datalist) that will execute the stored procedure I have to update the ratings table (I already have the stored proc...just need to know how to call a function with the rating control).
I typically program in VB but I'll understand C# too.
Code:
<asp:DataList ID="DataList1" runat="server" DataSourceID="SqlDataSource1" RepeatLayout="Flow">
<ItemTemplate>
<div class="Rating">
<ajaxToolkit:rating ID="SongRating" runat="server"
CurrentRating='<%# Eval("USERRATING") %>'
MaxRating="5"
StarCssClass="ratingStar"
WaitingStarCssClass="filledRatingStar"
FilledStarCssClass="filledRatingStar"
EmptyStarCssClass="emptyRatingStar"
/>
<span class="SmallText">avg: <%# Eval("AVGRATING") %></span>
</div>
</ItemTemplate>
</asp:DataList>
When a user clicks on one of the rating controls, how would I go about calling a function (passing in the ID parameter from my datalist) that will execute the stored procedure I have to update the ratings table (I already have the stored proc...just need to know how to call a function with the rating control).
I typically program in VB but I'll understand C# too.
Comment