autopostback and validator

3 posts, 0 answers
  1. Josep Bonet
    Josep Bonet avatar
    9 posts
    Member since:
    Aug 2009

    Posted 10 Sep 2010 Link to this post


    I have an RadComboBox with autopostback set to "true". I've also a requiredvalidator on the RadComboBox. The Combo containes a "Select" element with a value "-1". When I switch from one item to the "Select" item, the validator fires and displays but the combo still makes a postback.


    <telerik:RadComboBox runat="server" ID="uxDepartment" Width="325px" AutoPostBack="true"
            CausesValidation="false" OnSelectedIndexChanged="uxDepartment_SelectedIndexChanged" />
    <asp:RequiredFieldValidator runat="server" InitialValue="-1"
              ControlToValidate="uxDepartment" ErrorMessage="<%$ Resources:UI,inputRequired %>" />

    Telerik version is 2010.2.826.35

    Any idea?

    Best regards
  2. Cori
    Cori avatar
    562 posts
    Member since:
    Jul 2010

    Posted 10 Sep 2010 Link to this post

    Hello Josep,

    You have CausesValidation="false" on your RadComboBox, which excludes the control from being validated. Just remove that and the postback should be prevented by the validator.

    I hope that helps.
  3. Silvio Silva Junior
    Silvio Silva Junior avatar
    100 posts
    Member since:
    Mar 2010

    Posted 14 Dec 2013 Link to this post

Back to Top