0

I have a form with two parts. The top part allows the user to select items they want to purchase. I installed the Ajax toolkit from Microsoft, then I put a update panel on the top part. It works fine. When a user clicks the "update" button, it will update the final price of all the items they have selected.

Here's my problem. The lower part of the form is where they can enter their personal information. When the user clicks the "update" button on the top part, the lower parts validate is triggered. My update panel is only on the top part. Why is it acting like the entire form is submitted when the user clicks the button located inside of my update panel? Shouldn't ajax only send information in the update panel to the server?

Thanks for any help.

2
  • Are you using the ValidationGroup property for your validation controls and your buttons? Commented Jun 17, 2013 at 12:52
  • Post your markup, it will be easier to identify the issue. Commented Jun 17, 2013 at 13:15

1 Answer 1

1

Because whenever you click on update button, the page will do a postback (in case of update Panel also). So in case of postback, everything inside <form id="form1" runat="server"> will be posted to server.

You can use ValidationGroup and CausesValidation property for specific validations.

Sign up to request clarification or add additional context in comments.

3 Comments

Please forgive me for my ignorance, but I thought the beauty of ajax was that you did not have to send all the data back to the server, but could instead post only a small portion of the page. (suppose to save on traffic). Also, how can I prevent the Validations from firing? (example please)
UpdatePanel isn't true AJAX in that sense. Read this article to get an idea of the differences: msdn.microsoft.com/en-us/magazine/cc163413.aspx
@TheBigOnion - Update Panel are no more used in VS 2010.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.