Wednesday, March 28, 2012

Multiple update panels with triggers

I'm having a hard time figuring out how to accomplish the following. Any help would be GREATLY appreciated:

I have a section with radiobuttonlists and checkboxes. I wrapped them in an updatepanel and they work great.

The problem is that the radiobuttonlists and checkboxes also have customvalidators on them, which unfortunately doesn't work correctly. My validatorsummary is at the bottom of the page and is not included in the updatepanel. What do I need to do to get all this to work properly?

Thanks!

In what way is it not working properly?


If they aren't in an UpdatePanel, they can't update as result of a partial postback. One thing you can do is put them in another UpdatePanel with async postback triggers for the checkboxes and radiobuttons.

hi

Do have try to use ValidatorCallout control of ajax control toolkit i think it may help you


DisturbedBuddha:

In what way is it not working properly?

On the custom validator, I set text="*" and errorMessage="Danger Will Robinson"... I see the * next to the control that is in the updatePanel, but the error message does not display in the validatorsummary, which is outside of the updatePanel


qt1329a is slightly mistaken. The validation summary should appear even if not placed in an update panel. Validation always occurs on the server, but unless you've specifically disabled client-side validation, it will validate in the browser first and cancel the post to the server if there is a problem. For an in-depth explanation of how that works, read "Client-Side Validation" athttp://quickstarts.asp.net/QuickStartv20/aspnet/doc/validation/default.aspx. So basically, a postback is not usually required for a validator to fire.

Some versions of the validators (as well as other controls) are not compatible with the UpdatePanel. You can try this fix: http://blogs.msdn.com/mattgi/archive/2007/01/23/asp-net-ajax-validators.aspx

But in the meantime, you could post your source code and I can see if it's just a simple correction.

No comments:

Post a Comment