validate radrating

2 posts, 0 answers
  1. Sigma
    Sigma avatar
    87 posts
    Member since:
    Apr 2012

    Posted 26 Nov 2012 Link to this post

    I have a radrating in my form. I want to validate whether the rating is checked using a customvalidator. Please help me to achieve this scenario.
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 26 Nov 2012 Link to this post

    Hi Sigma,

    Try the following code snippet to achieve your scenario.

    <telerik:RadRating ID="RadRating1" runat="server">
    <asp:CustomValidator ID="CustomValidator1" runat="server" ErrorMessage="Please rate"
        ControlToValidate="RadRating1" OnServerValidate="CustomValidator1_ServerValidate"
    <br />
    <telerik:RadButton ID="RadButton1" runat="server" Text="RadButton">

    protected void CustomValidator1_ServerValidate(object source, ServerValidateEventArgs args)
        args.IsValid = (Int32.Parse(args.Value) > 0);

    Please take a look into this documentation for more information.

Back to Top