How to iterate through various controls of all Views in a Multiview control and display a Summary message in ASP.Net?
Posted on 2009-05-06
I'm using a Multiview control having 6 views named as View1, View2,&.View6. I'm also using 6 LinkButtons named as 1 2 3 4 5 6 located at the bottom of the Multiview control. Each of the LinkButton when clicked causes a postback and sets the corresponding ActiveIndexView property of the Multiview control.
Each of the Views has controls like textboxes, dropdowns, checkboxes etc. which if the user is required to enter is indicated with a red * sign, but there are no validation controls used (because of the business rules).
View6 has a Submit Application button which when clicked should go through the controls of all the six views. If the user hasnt entered values for any of the required fields in any of the Views, it should give a summary kind of a message in the following format:
First Name is required
No. of years of Experience was not selected
Person to contact was not entered.
Hobbies not entered.
I'm using C# language as the code-behind.