Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx thread: causesvalidation=true


Message #1 by "John Tyson" <jtyson@t...> on Tue, 10 Dec 2002 09:59:54 -0800
Hi,

Can I use causesValidation=3DTrue with an asp:textbox control that also
has an onTextChanged event?  The onTextChanged event causes the record
to be saved; I placed "If Page.IsValid" in my Sub and
CausesValidation=3D"True" in my asp:TextBox line but I still get
"Page.IsValid cannot be called before validation has taken place" error.

Thank you,

John
Message #2 by "jayathakar" <jayathakar@y...> on Wed, 18 Dec 2002 17:20:03
> Hi,

Can I use causesValidation=3DTrue with an asp:textbox control that also
has an onTextChanged event?  The onTextChanged event causes the record
to be saved; I placed "If Page.IsValid" in my Sub and
CausesValidation=3D"True" in my asp:TextBox line but I still get
"Page.IsValid cannot be called before validation has taken place" error.

Thank you,

John

John,
      Validation control events gets fired before any other control event.
So your textbox event will fire after the validation.If you want to do 
validation then set the visible property of you controls to FALSE and 
then in the textbox event set that again to TRUE, then call page.validate 
function explicitly.

Hope that helps
--Jaya

  Return to Index