Hi Shud,
Refer below sample.
HTML
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style type="text/css">
.Star
{
background-image: url(images/Star.gif);
height: 17px;
width: 17px;
}
.WaitingStar
{
background-image: url(images/WaitingStar.gif);
height: 17px;
width: 17px;
}
.FilledStar
{
background-image: url(images/FilledStar.gif);
height: 17px;
width: 17px;
}
</style>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript">
function Show() {
setTimeout('showData()', 1000);
};
function showData() {
document.getElementById("<%=Rating1.ClientID %>").style.display = "block";
document.getElementById("<%=lblRatingStatus.ClientID %>").style.display = "block";
}
</script>
</head>
<body>
<form id="form1" runat="server">
<cc1:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
</cc1:ToolkitScriptManager>
<cc1:Rating ID="Rating1" AutoPostBack="true" runat="server" Style="display: none"
CssClass="rating" StarCssClass="Star" WaitingStarCssClass="WaitingStar" EmptyStarCssClass="Star"
FilledStarCssClass="FilledStar">
</cc1:Rating>
<br />
<asp:Label ID="lblRatingStatus" runat="server" Text="" Style="display: none"> </asp:Label>
<br />
<asp:Button Text="Show Rating" runat="server" OnClick="Show" />
</form>
</body>
</html>
Code
C#
protected void Show(object sender, EventArgs e)
{
Rating1.CurrentRating = 2;
lblRatingStatus.Text = string.Format("{0} Users have rated. Average Rating {1}", 5, 1);
ClientScript.RegisterStartupScript(this.GetType(), "alert", "Show();", true);
}
VB.Net
Protected Sub Show(ByVal sender As Object, ByVal e As EventArgs)
Rating1.CurrentRating = 2
lblRatingStatus.Text = String.Format("{0} Users have rated. Average Rating {1}", 5, 1)
ClientScript.RegisterStartupScript(Me.GetType(), "alert", "Show();", True)
End Sub
Screenshot