Add (Implement) 5 Star Rating System using AJAX Rating Extender in ASP.Net

Last Reply 7 months ago By dharmendr

Posted 7 months ago

Below is my sample code the gif images are from your solution but I see 4 stars instead of 1 star.

ASP.Net AJAX Rating Extender Control Database Example – How to save and display Average Rating value from database

So I am seeing 10 stars in 2 lines and 1 star is equal to 2 stars of both lines.

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="WebForm1.aspx.vb" Inherits="WebApplication1.WebForm1" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<head runat="server">
    <style type="text/css">
.emptypng {
    background-image: url(Star.gif);
    width: 32px;
    height: 32px;
.smileypng {
    background-image: url(FilledStar.gif);
    width: 32px;
    height: 32px;
.donesmileypng {
    background-image: url(FilledStar.gif);
    width: 32px;
    height: 32px;
    <form id="form1" runat="server">
        <asp:ScriptManager ID="asm" runat="server"></asp:ScriptManager>
    <asp:Table ID="TableContent" runat="server">


Public Class WebForm1
    Inherits System.Web.UI.Page
    Protected Sub Page_PreInit(ByVal sender As Object, ByVal e As EventArgs) Handles Me.PreInit
    End Sub
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    End Sub
    Private Sub GetMenuHtml()
        Dim tr As TableRow = New TableRow()
        Dim td As TableCell = New TableCell()
        Dim rbuttons As AjaxControlToolkit.Rating = New AjaxControlToolkit.Rating
        rbuttons.ID = "test"
        rbuttons.MaxRating = 5
        rbuttons.AutoPostBack = True
        rbuttons.EmptyStarCssClass = "emptypng"
        rbuttons.FilledStarCssClass = "smileypng"
        rbuttons.StarCssClass = "smileypng"
        rbuttons.WaitingStarCssClass = "donesmileypng"
        td.Controls.Add(New LiteralControl("<br/>"))
        td.Controls.Add(New LiteralControl("<br/>"))
    End Sub
End Class


This question does not have replies that have been liked.