2 posts, 0 answers
  1. Allen
    Allen avatar
    21 posts
    Member since:
    Aug 2007

    Posted 06 May 2010 Link to this post

    I am trying to use a standard asp:RequiredFieldValidator with the control, but keep getting an error message "Control [rating] referenced by the ControlToValidate property of  [validator] cannot be validated."  I have other validators on the form that work fine.  Can this type of control not be validated this way?

  2. Tsvetie
    Tsvetie avatar
    1517 posts

    Posted 10 May 2010 Link to this post

    Hi Allen,
    Yes, you are correct - currently the rating control cannot be validated with a RequiredFieldValidator control. You can use a CustomValidator control instead. For example:
    <script type="text/javascript">
        function ClientValidate(source,arguments)
            var ratingValue = $find("<%= RadRating1.ClientID %>").get_value();
            if (ratingValue == 0)
                arguments.IsValid = false;
            } else
                arguments.IsValid = true;
    <telerik:RadRating ID="RadRating1" runat="server">
    <asp:CustomValidator ID="CustomValidator1" runat="server" ClientValidationFunction="ClientValidate"
        Display="Static" ErrorMessage="Please rate!"></asp:CustomValidator>
    <asp:Button ID="Button1" runat="server" Text="Postback" />

    Sincerely yours,
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Back to Top