mobileNavlogo
headerlogo

Ajax Rating Control

Blog Author

Tekslate

Published Date

20th September, 2018

Ratings

Views

763

  • Share this blog :

Rating

Rating control is used to accept rating from user and it has the following important properties. Starcss class: Used to specify the css class to use to display the star within the rating control. Empty starcssclass: Used to specify the cssclass to use to display an empty star with the Rating control. Filledstarcssclass: Used to specify the cssclass to use to display a filledstar with in the rating control. Waiting starcssclass: Used to specify the css class to use to display the star that is waiting to be selected. MaxRating: Used to specify the maximum rating user can select. CurrentRating: Used to get or set the current rating. Example The following example demonstrates how to use the rating control. Add a page to the website and place a ToolKitScriptManager, aRating Control & a Label on the page. With in the HTML Source of the page in the headsection create css class as follows. <style type=”text/css”> .star { width:30px; height:30px; background-repeat: no-repeat; padding:0px; margin:0px; } .emptystar { background-Image:Url(Images/emptystar.png); } .filledstar { background-Image:Url(Images/filledstar.png); } </style> Within HTML source it self set following properties for the Rating control. <asp:Rating ID=”Rating1” runat=”server” starcssclas=”Star” Emptystarcssclass=”emptystar” filledstarcssclass=”filledstar” waitingstarcssclass=”emptystar” MaxRating=”5” CurrentRating=”2” AutpostBack=”True”> <asp:Rating> For the label make the text property empty and write the following code with in ‘changed’ event of rating control. Rating1-changed { Label1.text=”Rating Given Is” + Rating1.currentRating.Tostring(); } } site www.asp.net/ajax

About Author
Authorlogo
Name

TekSlate

Author Bio

TekSlate is the best online training provider in delivering world-class IT skills to individuals and corporates from all parts of the globe. We are proven experts in accumulating every need of an IT skills upgrade aspirant and have delivered excellent services. We aim to bring you all the essentials to learn and master new technologies in the market with our articles, blogs, and videos. Build your career success with us, enhancing most in-demand skills .

Related Blogs

Write For Us