Problem in validation summary and AJAX sync

Last post 07-06-2009 2:38 AM by mihir.mone. 5 replies.

Sort Posts:

  • Problem in validation summary and AJAX sync

    07-02-2009, 10:01 AM
    • Member
      10 point Member
    • man_gurav
    • Member since 04-17-2008, 12:28 PM
    • Pune, India
    • Posts 33

    Below is my scenario.

    I have 2 different blocks (update panels Blk1 and Blk2) on my page and two buttons (button Bt1 and button Bt2). Both the blocks have some textboxes and a requiredfieldvalidators attached to it.

    On Bt1 click, only Blk1 is getting updated using AJAX. Fields in Blk1, Blk2 and button Bt2 are in same validation group. I am showing error messages in ErrorSummary control.

    I have not entered any data in any field. Now if I hit Bt2 after page loads, all error messages are shown in ShowSummary box of ErrorSummary control. Whereas if I hit Bt1 and then again hit Bt2, error messages from Blk2 are shown twice. if I again hit Bt1 and then hit Bt2, error messages from Blk2 are shown thrice and so on. Error messages from Blk1 shows up only once each time.

    Any idea about this behavior.

    Thanks,

    Mangesh

  • Re: Problem in validation summary and AJAX sync

    07-04-2009, 7:53 AM
    • Member
      73 point Member
    • saurabh2k4mc095
    • Member since 10-03-2008, 8:00 AM
    • New Delhi
    • Posts 18

    Hi Mangesh,

    Take two validation summary like vs1 and vs2

    on button1 write validationgroup=vs1 and on button2 write validationgroup=vs2

    and also write down the different validation groups according to the buuton you have clicked.

    hope it will work

    if correct then mark as a answer.

    Remember to click “Mark as Answer” on the post, if it helps you. Because It helps others to find the solution

    Thanks.
    ~Saurabh
  • Re: Problem in validation summary and AJAX sync

    07-06-2009, 1:40 AM
    • Member
      10 point Member
    • man_gurav
    • Member since 04-17-2008, 12:28 PM
    • Pune, India
    • Posts 33

    Hi Saurabh,

    Thanks for the reply.

    Probablyl I should have mentioned it beforehand that I am using 2 validation groups only, but the problem is my requirement as per which I have 2 buttons on my form. For one button, I need to validate controls in one block only so its same situation as you are saying and works fine, but  on the second button, I need to validate fields from both the panels. Even I tried 2 validators for a same field with different validation groups but still it don't work properly.


  • Re: Problem in validation summary and AJAX sync

    07-06-2009, 1:55 AM
    • Member
      258 point Member
    • mihir.mone
    • Member since 05-20-2008, 12:59 AM
    • Mumbai, India
    • Posts 73

    Hello,

    You may take 3 summary controls.

    1 for each block and a 3rd for common, do not mention any validationGroup property name for it.

    I hope this will work.

    Mihir,
    Software Professional
    http://mihirhere.spaces.live.com
  • Re: Problem in validation summary and AJAX sync

    07-06-2009, 2:19 AM
    • Member
      10 point Member
    • man_gurav
    • Member since 04-17-2008, 12:28 PM
    • Pune, India
    • Posts 33

    Can't do that because as per my understanding, I can bind only one validation group to a button. Well, I can fire validation request/s explicitly for the other group/s from javascript or something but still it will be a lengthy way. In actual scenario, In both blocks, I have grids having 5 and 8 rows respectively. Row can get added dynamically to grid so ultimately it'll be              

    total number of validators = (num of columns X num of rows X num of validators)

    My page is already very bulky and I can't afford more size as it'll slow down my page.

    Isn't there any way to manipulate error messages shown in validation summary through javascript or something similar to single validator control?

    Any idea what property of validationSummary control holds all these messages. May be I can clear it from JS. I tried to search for it but couldn't found one.


  • Re: Problem in validation summary and AJAX sync

    07-06-2009, 2:38 AM
    Answer
    • Member
      258 point Member
    • mihir.mone
    • Member since 05-20-2008, 12:59 AM
    • Mumbai, India
    • Posts 73

    Yes, you are right.

    Probably you can use pure JS validations to serve the purpose.

    Mihir,
    Software Professional
    http://mihirhere.spaces.live.com
Page 1 of 1 (6 items)