|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Multiview and ValidationI am using a Multiview control and some validators.
The multiview is being used in a homegrown tab control Click on a tab it display one of the views. I have a submit button that I would like to validate all of the controls in all of the views within the multivew. I am guessing their is no way this going to happen on the client, since the controls on the non-displayed views are not available to the DOM/javascript? However, on page postback if I do page.validate, page.isValid. I don't believe the controls in the other views are being tested. How can I validate all the controls within the multiview? Hi Chuck,
It's a design decision that controls/validators in a hidden View will not be validated; also you're right about the client-side validation: the controls inside hidden View aren't rendered to client at all, thus not possible to validate them at client-side. As a workaround, I'm afraid you will have to manually make each View active then do the validation again: private void ValidateMultiView(MultiView mv) { int savedIndex = mv.ActiveViewIndex; for (int i = 0; i < mv.Views.Count; i++) { mv.ActiveViewIndex = i; Page.Validate(); } mv.ActiveViewIndex = savedIndex; } Note: if you have code in the MultiView's event ActiveViewChanged, please be aware that above code will trigger the event too; you might want to use a member variable to bypass the logic there if it's caused by this function. Sincerely, Walter Wang (waw***@online.microsoft.com, remove 'online.') Microsoft Online Community Support ================================================== Get notification to my posts through email? Please refer to http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif ications. If you are using Outlook Express, please make sure you clear the check box "Tools/Options/Read: Get 300 headers at a time" to see your reply promptly. Note: The MSDN Managed Newsgroup support offering is for non-urgent issues where an initial response from the community or a Microsoft Support Engineer within 1 business day is acceptable. Please note that each follow up response may take approximately 2 business days as the support professional working with you may need further investigation to reach the most efficient resolution. The offering is not appropriate for situations that require urgent, real-time or phone-based interactions or complex project analysis and dump analysis issues. Issues of this nature are best handled working with a dedicated Microsoft Support Engineer by contacting Microsoft Customer Support Services (CSS) at http://msdn.microsoft.com/subscriptions/support/default.aspx. ================================================== This posting is provided "AS IS" with no warranties, and confers no rights.
Login control - image button with text over it
how to get selectedvalue of radiobuttonlist in Javascript? List Box : help preventing duplicate items GridView EnableSortingAndPagingCallBacks Select command. Searching for a powerfull calendar addon User Control used in Repeater, but no output Accessing USER CONTROL which is inside Masterpage through Another USER Control inside normal page. Use CSS in themes get a filename for a bitmap in a skin StyleSheetTheme not working |
|||||||||||||||||||||||