tags:

views:

106

answers:

2
+1  Q: 

ASP.NET validation

I have a little problem with the validation in one form the form is composed by two taqs. There is a "Save" button in each tap (is the same control for both) and saves the form info. there are validation controls in one tab but not in the second. When we try to save the info from the second tab, and the info has not been filled in the first tab, the validators fire, and nothing happends, but because this validators are shown in the other tab, the end user might be thinking that the operation has been completed, instead, I would like to show a msgBox telling the user about the errors in the other tab. How do I know that the validators in the other tab have been fired, and display the error message when the button is clicked?

Many thanks in advanded guys

+1  A: 

You should use the ValidationGroup of your validator controls and the appropriate submit button. You can also use a ValidationSummary control which displays a summary of the validation messages - this can be set to display a message box if you want by setting the property ShowMessageBox=true.

mdresser
A: 

taqs - tap

dear why are you so confused?

All the validators are posted to the page as JavaScript functions. You can call the validation function on button's click and take the appropriate action.

You can use on buttons

onClientClick="Page_ClientValidate();"
TheVillageIdiot
Please will I get the reason for down-vote?
TheVillageIdiot
thanks man, that is what i was looking for. It worked perfectly,I apreciate your help mate!!
@Javier it feels great when I can help some fellow programmer.
TheVillageIdiot