locked
Composite control and CausesValidation not working RRS feed

  • Question

  • User-1935666739 posted

    Dear all,


    I have build a composite control containing a Label, TextBox and a ImageButton. The idea:

    Label text | textbox | imagebutton used for triggering an event

    This textbox has a build-in validation.

    When the imagebutton is set, i will use this imagebutton as a trigger. This imagebutton has an onclick event.  Nou my problem is the following:

    When i have my textbox on a form an click a button to validate my textbox validation takes place correctly.

    If my textbox has the imagebutton enabled and i click this imagebutton validation takes place.

    In my composite control i have implicity set imagebutton.CausesValidation = false;

    But when clicking this buttonvalidation still occurs. Does anyone has a solution for this problem because i have tried everything i could think of :-(


    Thanx a lot

    Saturday, January 16, 2010 4:17 PM

Answers

  • User-16411453 posted

    There's no code example to look at, just your description of the issue at hand.

    I have no idea of what your coding style looks like, or how you build your composite control logic.

    So help is difficult to offer.

    I forgot to memtion the validation group name, and setting it for each object in the group.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, January 18, 2010 5:57 PM

All replies

  • User-16411453 posted

    Thats a needle in the haystack

    If using With, did you put a dot in front of it

    With

    .CauseValidatiuon = false

    End With

    Sunday, January 17, 2010 12:53 AM
  • User-1935666739 posted

    Hey jkirkerx,

    Thanx for your response. Ofcourse i have a . before it otherwise i get a build error. :-)

    I have read somewhere that the Causes Validation on childcontrols not working properly. But i don't' know why this would not work.

    This is a tuff one.  I really do not have the answer :-(



    Sunday, January 17, 2010 6:44 AM
  • User-1935666739 posted

    Hey all,


    After a whole weekend fighting with my control i finally found the solution.

    I need to set enable viewstate = false for my imagebutton control. So now it doesn't validate Pffffff.

    Sometimes it's good to take a break so you can think simple again and whalaa there it is.

    As simple as can be :-)


    Greatings


    Monday, January 18, 2010 2:48 PM
  • User-16411453 posted

    There's no code example to look at, just your description of the issue at hand.

    I have no idea of what your coding style looks like, or how you build your composite control logic.

    So help is difficult to offer.

    I forgot to memtion the validation group name, and setting it for each object in the group.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, January 18, 2010 5:57 PM