Updatepanel VS. Ajax Validators

Last post 09-02-2008 1:13 AM by bosboss. 2 replies.

Sort Posts:

  • Updatepanel VS. Ajax Validators

    09-01-2008, 10:42 PM
    • Member
      2 point Member
    • bosboss
    • Member since 03-13-2007, 11:11 PM
    • Posts 32

    I have different kinds of Ajax validators(http://blogs.msdn.com/mattgi/archive/2007/01/23/asp-net-ajax-validators.aspx) in the UpdatePanel which validate different TextBoxs which have TextChanged event, and got the following two strange behavious.  I have tried the ASP.NET validators too and got the same problems.  I think the problem is from the Async postback of UpdatePanel.

    1. Type in some invalid values in TextBox.  Once the focus leaves the TextBox, the validation error message appears for a second and then disappear. 

       - Expect result: The error message shoud not appear before the button is clicked.

    2. Click a Button outside of UpdatePanel, the error messages can appear normally.  But once click any control that cause the post back, ALL error messages of other validators disappear.

      - Expect result: The error message for other validators should stay

     Can anyone explain why and find the solutions?  Thanks a lot!

     

  • Re: Updatepanel VS. Ajax Validators

    09-02-2008, 12:32 AM
    • Star
      8,709 point Star
    • Pawan_Mishra
    • Member since 03-13-2008, 7:37 AM
    • Bangalore
    • Posts 1,272

    Hello

    To make the validators compatible with update panel set the EnableClientScript property to false . During asynchronous postback server side validation will work but since content is inside updatepanel the feedback will be immediate .

    Regards
    Pawan Mishra

    Too many eyes doesn't make a good code !!!

    .Net 360°
  • Re: Updatepanel VS. Ajax Validators

    09-02-2008, 1:13 AM
    • Member
      2 point Member
    • bosboss
    • Member since 03-13-2007, 11:11 PM
    • Posts 32

    Are ther any way to do client validation first?  How to have other error messages stay on the page?

Page 1 of 1 (3 items)