Skip to main content
Tab

ASPxRatingControl Class

Represents a rating control.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v21.2.dll

Declaration

public class ASPxRatingControl :
    ASPxWebControl,
    IRequiresLoadPostDataControl

Remarks

The ASPxRatingControl class implements the functionality of a rating control, which enables end-users to rate by selecting a number of items (stars).

ASPxRatingControl_control

Create a Rating Control

Design Time

The ASPxRatingControl control is available on the DX.21.2: Common Controls toolbox tab in the Microsoft Visual Studio IDE.

Drag the control onto a form and customize the control’s settings, or paste the control’s markup in the page’s source code.

<dx:ASPxRatingControl ID="ratingControl" runat="server" Value="4" />

Run Time

using DevExpress.Web;
...
protected void Page_Load(object sender, EventArgs e)
{
    ASPxRatingControl ratingControl = new ASPxRatingControl();
    ratingControl.ID = "ratingControl";
    Page.Form.Controls.Add(ratingControl);
    ratingControl.Value = 4;
}

Note

DevExpress controls require that you register special modules, handlers, and options in the Web.config file. You can change this file or switch to the Design tab in the Microsoft Visual Studio IDE to automatically update the Web.config file. Note that this information is automatically registered if you use the DevExpress Template Gallery to create a project.

The appearance of the control can be customized using the standard control properties.

Items within the control can be customized by using the following item characteristics: item images (the ASPxRatingControl.ImageMapUrl property along with the ASPxRatingControl.ItemWidth and ASPxRatingControl.ItemHeight properties), titles of items (the ASPxRatingControl.Titles property), if it is a fractional number, the way in which items are filled to represent the control’s value (the ASPxRatingControl.FillPrecision property).

The control’s value is specified via the ASPxRatingControl.Value property.

Note

The client-side equivalent of this rating control is represented by the ASPxClientRatingControl object. The control’s client-side API is enabled if the ASPxRatingControl.ClientInstanceName property is defined or any client event is handled. Available client events can be accessed via the ASPxRatingControl.ClientSideEvents property.

See Also