title: Client-side validation is not firing on my custom BaseValidator
body: <p>So, I'm writing a custom validator to validate the Ajax Toolkit's Rating control.  The client side validation isn't firing, though.</p>
  
  <p>I have this method to register the script:</p>
  
  <pre><code>protected override void OnPreRender(EventArgs e)
  {
      base.OnPreRender(e);
      string script = @"&lt;script type=""text/javascript""&gt;function RatingValidatorEvaluateIsValid(val)
  {
      alert( 'here' );
      return false;
  }&lt;/script&gt; ";
  
      Page.ClientScript.RegisterClientScriptBlock(GetType(), "ratingValidator", script);
  }
  </code></pre>
  
  <p>And I register the attribute like this:</p>
  
  <pre><code>protected override void AddAttributesToRender(System.Web.UI.HtmlTextWriter writer)
  {
      base.AddAttributesToRender(writer);
  
      // Add the client-side code (if needed)
      if (this.RenderUplevel)
      {
          writer.AddAttribute("evaluationfunction", "RatingValidatorEvaluateIsValid", false);
      }
  }
  </code></pre>
  
  <p>The script appears on the page, as well as the attribute, but the <code>alert('here')</code> never appears.</p>
  
  <p>(Everything works fine, Server-side)</p>
  
  <p><strong>Edit</strong> Markup:</p>
  
  <pre><code>&lt;ajaxToolkit:Rating ID="ajaxRating" runat="server" StarCssClass="ratingStar" WaitingStarCssClass="savedRatingStar" 
                  FilledStarCssClass="filledRatingStar" EmptyStarCssClass="emptyRatingStar" CssClass="stars"
                  RatingAlign="Horizontal" RatingDirection="LeftToRightTopToBottom" 
                  AutoPostBack="True" OnChanged="OnChanged" /&gt;
  &lt;my:RatingValidator runat="server" ID="RatingValidator" ControlToValidate="ajaxRating"
  ErrorMessage="Please select a rating." EnableClientScript="True"
  &lt;/my:RatingValidator&gt;
  </code></pre>
  
  <p><strong>Edit 2</strong> Okay, this is weird...</p>
  
  <p>The <code>span</code> that gets generated is proper:</p>
  
  <pre><code>&lt;span id="CPHUser_rating_RatingValidator" evaluationfunction="RatingValidatorEvaluateIsValid" style="visibility:hidden;"&gt;Please select a rating.&lt;/span&gt;
  </code></pre>
  
  <p>But the JS at the bottom doesn't have my evaluationfunction assigned.</p>
  
  <pre><code>var CPHUser_rating_RatingValidator = document.all ? document.all["CPHUser_rating_RatingValidator"] : document.getElementById("CPHUser_rating_RatingValidator");
  CPHUser_rating_RatingValidator.controltovalidate = "CPHUser_rating_ajaxRating";
  CPHUser_rating_RatingValidator.errormessage = "Please select a rating.";
  </code></pre>