I started playing with the jQuery Star Rating Plugin v3.14. But, I could not really find a good way to make web method calls or a decent write up of how to use it with ASP.Net.
So, I added auto-submit-star to the markup for it to make the callback, added runat=”server”, and a hidden field with the record id.
<input name="star1" type="radio" class="auto-submit-star" runat="server"> <input name="star1" type="radio" class="auto-submit-star" runat="server"> <input name="star1" type="radio" class="auto-submit-star" runat="server"> <input name="star1" type="radio" class="auto-submit-star" runat="server"> <input name="star1" type="radio" class="auto-submit-star" runat="server"> <asp:HiddenValue id="hfRatingID" runat="server"/>
After that, added the following script that performs the jQuery Web Method call
$(".auto-submit-star").rating({ callback: function (a, b) { PageMethods.RateIt( $(this).siblings('input[id*="hfRatingID"]').val(), a) }})
Then makes web method call to a static class in code behind
[System.Web.Services.WebMethod()] [System.Web.Script.Services.ScriptMethod()] public static void RateIt(int id, string value) // Method have to be static { // Make call to update DB rating value }
Now you should be able to make an asynchronous call for users to rate an item. Hope this helps.