Thanks for all of the information, i found it really usefull.
> 4. Users can also call the Validate() method on individual validators and
> check their IsValid property to see the result. If you want to support
this,
> I recommend adding a method to your custom control called Validate() that
> fires the Validate() methods on each validator. Also include an IsValid
> property which returns true if all validators are valid.
ensure that this gets fired.
has it causesvalidation property set to true.
"Peter Blum" <PLBlum@Blum.info> wrote in message
news:uSgN$GxWFHA.1148@tk2msftngp13.phx.gbl...
> Do not manually validate insider your custom control. Always let the page
> developer identify exactly when validation occurs.
> 1. Buttons automatically call the Page.Validate() method for you unless
> their CausesValidation property is false. This happens in their OnClick
> method after Page_Load is done an before calling your Click event method.
> Page.Validate() will run your validators.
>
> 2. Sometimes a button should never validate, such as a Cancel button.
Again
> the user takes control by setting CausesValidation to false.
>
> 3. AutoPostBack never calls Page.Validate(). If the user elects to
validate
> on autopostback, they add a call to Page.Validate() in their own event
> handler for that post back.
>
>
> --- Peter Blum
>
www.PeterBlum.com > Email: PLBlum@PeterBlum.com
> Creator of "Professional Validation And More" at
>
http://www.peterblum.com/vam/home.aspx >
> "Martin" <martin_no_spam@martinz.co.nz> wrote in message
> news:OYgcT%23qWFHA.132@TK2MSFTNGP14.phx.gbl...
> > Hi,
> >
> > I have an asp.net page with two composite controls on it as well as a
> > single
> > button in the asp.net page AND a single dropdown box on the page that
has
> > its autopostback property set to true so that it posts back when ever
the
> > selection is changed.
> >
> > what i would like to do is when the button (in the aspx page NOT on any
of
> > the composite controls) is clicked and causes a postback to validate
both
> > composite controls - however i want no validation to occur if the
dropdown
> > box causes the postback.
> >
> > I have implemented IPostBackDataHandler in both controls and have
verified
> > that they are both notified when the button in the page is clicked.
> > so i figured that i could validate each control in its respective
> > "RaisePostDataChangedEvent"
> >
> > so basically i need to work out how to know exactly which element on the
> > page caused a postback.
> >
> > I therefore have two questions.
> >
> > 1. Is my method of validating each composite control on a page in it's
> > respective "RaisePostDataChangedEvent" the correct way of achieving such
a
> > feet or do I need to re-think my stagegy, if so any advice is welcome..
> >
> > 2. How do I tell exactly tell which element on a page caused a postback.
> >
> > I appreciate any feedback or pointers to article of interest.
> >
> > thanks in advance.
> >
> > cheers
> >
> > martin.
> >
> >
>
>