• USA : +1 973 910 5725
  • INDIA: +91 905 291 3388
  • info@tekslate.com
  • Login

Ajax Rating Control

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

Summary
Review Date
Reviewed Item
Ajax Rating Control
Author Rating
5

“At TekSlate, we are trying to create high quality tutorials and articles, if you think any information is incorrect or want to add anything to the article, please feel free to get in touch with us at info@tekslate.com, we will update the article in 24 hours.”

0 Responses on Ajax Rating Control"

Leave a Message

Your email address will not be published. Required fields are marked *

Site Disclaimer, Copyright © 2016 - All Rights Reserved.