Re: Validator message disappeared after post back

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Hi HipHop,

To make the validator work in or before a postback, the control who will
cause the postback must have CausesValidation set to true. Would you please
set the TextBox's CausesValidation to true and test it again:

<asp:TextBox ID="TextBox1" runat="server" CausesValidation="true"
AutoPostBack="true" OnTextChanged="TextBox1_TextChanged"></asp:TextBox></td>


I've tested it on my side using your code, if the CausesValidation is set
to true, the page will not be posted back since client-side validation is
enabled and the validation result is false, therefore it prevents the page
being posted back.


Regards,
Walter Wang (wawang@xxxxxxxxxxxxxxxxxxxx, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

.



Relevant Pages

  • Re: ICallbackEventHandler and "Invalid postback or callback argument" error
    ... Event validation checks that postback data came from a control that was ... "Invalid postback or callback argument. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: ICallbackEventHandler and "Invalid postback or callback argument" error
    ... or register you own validation routine for the effected controls. ... second ddl, when a button web server control is pressed, caused a normal ... "Invalid postback or callback argument. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Validator message disappeared after post back
    ... the error message will disappear after a post ... To make the validator work in or before a postback, ... cause the postback must have CausesValidation set to true. ... enabled and the validation result is false, ...
    (microsoft.public.dotnet.framework.aspnet.buildingcontrols)
  • RE: Ajax and Fileupload
    ... the update panel does partial updates via xmlhttprequest. ... postback, you can do a server validate. ... However my page has some server side validation. ... I have tried dynamically adding a control via ...
    (microsoft.public.dotnet.framework.aspnet)
  • Ajax and Fileupload
    ... fileupload control. ... I get how to use a postback trigger to do a full ... However my page has some server side validation. ... I have tried dynamically adding a control via ...
    (microsoft.public.dotnet.framework.aspnet)