0

Hi All,

I have 6 fields (3 on the top) and (3 on the bottom). The 3 on the top are:

Current email:
New email:
Confirm email:
<Submit> <Cancel>

Current password:
New password:
Confirm password:
<Submit> <Cancel>

Also each one has a required field validations.

Now if someone fills the email section and presses submit, I get missing fields error in the password section. My question is how to separate the two section so that the submit button causes validation only to the fields its associated with?

thanks!

3
Contributors
4
Replies
5
Views
7 Years
Discussion Span
Last Post by all4peace
0

I LOVE ME! :) I found the answer to my question. I should by myself a cookie...

Anyways, the way to do it is by creating two User Controls. Each one will validation itself only!

I'm still going to test it.

1

From MSDN article - http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.commandfield.causesvalidation.aspx

SUMMARY:
Use the CausesValidation property to specify whether validation is performed when a button in a CommandField field is clicked. When this property is set to true, by default all validation controls on the page are validated. To limit validation to only a certain group of validation controls, create a validation group and then set the ValidationGroup property to the validation group's name.

Votes + Comments
Very accurate - Great answer
0

I wonder why this was moved, his is of interest in the C# forum too:(

No worries. I got my answer. It's a combination of C# and asp.net.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.