ASPForums.Net RSS Feedhttp://www.aspforums.net/Handlers/RSS.ashxLatest additions to the content that appears on ASPForums.Net(c) 2019 www.aspforums.com. All rights reserved.Add (Implement) 5 Star Rating System using AJAX Rating Extender in ASP.Net<p>Hi <a class="username" rel="anvina">anvina</a>,</p> <p>1. Register AjaxControlToolkit Assembly in the page.</p> <p>2. Instead of using ScriptManager use AjaxControlToolkit ToolkitScriptManager.</p> <p>3. Change the height and width of CSS.</p> <p>Check this example. Now please take its reference and correct your code.</p> <p><strong><span style="text-decoration: underline;">HTML</span></strong></p> <pre class="brush: html">&lt;%@ Register Assembly=&#34;AjaxControlToolkit&#34; Namespace=&#34;AjaxControlToolkit&#34; TagPrefix=&#34;cc1&#34; %&gt; &lt;!DOCTYPE html PUBLIC &#34;-//W3C//DTD XHTML 1.0 Transitional//EN&#34; &#34;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&#34;&gt; &lt;html xmlns=&#34;http://www.w3.org/1999/xhtml&#34;&gt; &lt;head runat=&#34;server&#34;&gt; &lt;title&gt;&lt;/title&gt; &lt;style type=&#34;text/css&#34;&gt; .emptypng { background-image: url(images/Star.gif); height: 17px; width: 17px; } .smileypng { background-image: url(images/FilledStar.gif); height: 17px; width: 17px; } .donesmileypng { background-image: url(images/FilledStar.gif); height: 17px; width: 17px; } &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;form id=&#34;form1&#34; runat=&#34;server&#34;&gt; &lt;div&gt; &lt;cc1:ToolkitScriptManager ID=&#34;ToolkitScriptManager1&#34; runat=&#34;server&#34;&gt; &lt;/cc1:ToolkitScriptManager&gt; &lt;asp:Table ID=&#34;TableContent&#34; runat=&#34;server&#34;&gt; &lt;/asp:Table&gt; &lt;/div&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt;</pre> <p><strong><span style="text-decoration: underline;">C#</span></strong></p> <pre class="brush: csharp">protected void Page_PreInit(object sender, EventArgs e) { GetMenuHtml(); } protected void Page_Load(object sender, System.EventArgs e) { } private void GetMenuHtml() { TableRow tr = new TableRow(); TableCell td = new TableCell(); AjaxControlToolkit.Rating rbuttons = new AjaxControlToolkit.Rating(); rbuttons.ID = "test"; rbuttons.MaxRating = 5; rbuttons.AutoPostBack = true; rbuttons.EmptyStarCssClass = "emptypng"; rbuttons.FilledStarCssClass = "smileypng"; rbuttons.StarCssClass = "smileypng"; rbuttons.WaitingStarCssClass = "donesmileypng"; rbuttons.CurrentRating = 3; td.Controls.Add(rbuttons); td.Controls.Add(new LiteralControl("&lt;br/&gt;")); td.Controls.Add(new LiteralControl("&lt;br/&gt;")); tr.Controls.Add(td); TableContent.Rows.Add(tr); }</pre> <p><span style="text-decoration: underline;"><strong>VB.Net</strong></span></p> <pre class="brush: vb">Protected Sub Page_PreInit(ByVal sender As Object, ByVal e As EventArgs) Handles Me.PreInit GetMenuHtml() 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 = &#34;test&#34; rbuttons.MaxRating = 5 rbuttons.AutoPostBack = True rbuttons.EmptyStarCssClass = &#34;emptypng&#34; rbuttons.FilledStarCssClass = &#34;smileypng&#34; rbuttons.StarCssClass = &#34;smileypng&#34; rbuttons.WaitingStarCssClass = &#34;donesmileypng&#34; rbuttons.CurrentRating = 3 td.Controls.Add(rbuttons) td.Controls.Add(New LiteralControl(&#34;&lt;br/&gt;&#34;)) td.Controls.Add(New LiteralControl(&#34;&lt;br/&gt;&#34;)) tr.Controls.Add(td) TableContent.Rows.Add(tr) End Sub</pre> <p><strong><span style="text-decoration: underline;">Screenshot</span></strong></p> <p><img src="https://i.imgur.com/P1wIsgO.jpg" alt="" width="249" height="119" /></p>https://www.aspforums.net:443/Threads/714216/Add-Implement-5-Star-Rating-System-using-AJAX-Rating-Extender-in-ASPNet/https://www.aspforums.net:443/Threads/714216/Add-Implement-5-Star-Rating-System-using-AJAX-Rating-Extender-in-ASPNet/Tue, 20 Aug 2019 06:07:13 GMT