CausesValidation issues? RadButton and RadComboBox

3 posts, 0 answers
  1. Rob Ainscough
    Rob Ainscough avatar
    262 posts
    Member since:
    Jan 2010

    Posted 05 Mar Link to this post

    I have a RadComboBox that I don't want to trigger any validation checking (I have several controls using asp:RequireFieldValidator) ... so I set the CausesValidation='false'

    <telerik:RadComboBox ID="rcb_Insurances" runat="server" Width="100%" AutoPostBack="true" CausesValidation="false"/>

     

    and on the same page I have a RadButton that I DO want to trigger validation checking so ...

    <telerik:RadButton ID="rbn_MakePayment" runat="server" Text="Pay Now" Font-Size="X-Large" OnClick="MakePayment" CausesValidation="true"></telerik:RadButton>

     

    So validation is NOT performed when I check an item in my RadComboBox.  However, when I click my RadButton validation is not triggered? 

    If I remove the CausesValidation=false on the RadComboBox then my RadButton will trigger validation.

    Ideas?

    Cheers, Rob.

     

     

  2. Rob Ainscough
    Rob Ainscough avatar
    262 posts
    Member since:
    Jan 2010

    Posted 05 Mar Link to this post

    After some more research I came across this Telerik article which has left me wanting a career change:

    ... https://docs.telerik.com/devtools/aspnet-ajax/controls/button/how-to/radbutton-validation-and-client-side-event-handlers

    So the validators I've setup on the controls will NOT be validated until AFTER I execute the code in my event handler method (OnClick="MakePayment").  At what point would this EVER EVER EVER be desirable????

    It also begs the question of what is the point to "CausesValidation" property if the control validation actually happens AFTER code execution?

    This is probably some bizarre limitation around HTTP and stateless, but I can't begin to understand what or why?  Sure the CausesValidation=true should operate the control validators first and if all valid, then continue to my MakePayment method.

    Is there any way around this bizarre process?

    Cheers, Rob.

     

     

  3. Rob Ainscough
    Rob Ainscough avatar
    262 posts
    Member since:
    Jan 2010

    Posted 06 Mar Link to this post

    I researched and tested some more and found a solution ... the Page.IsValid will be set based on the Validators evaluation.  So in my OnClick method I just need to check Page.IsValid and exit or proceed based on True/False.

    Cheers, Rob.

Back to Top