44,540 views 134 on YTPak
112 3

Published on 26 Nov 2012 | over 4 years ago

Text version of the video
csharp-video-tutorials.blogspot.com/2012/11/validationgroups-in-aspnet-part-50.html

Slides
csharp-video-tutorials.blogspot.com/2013/08/part-50-validation-groups.html

All ASP .NET Text Articles
csharp-video-tutorials.blogspot.com/p/free-aspnet-video-tutorial.html

All ASP .NET Slides
csharp-video-tutorials.blogspot.com/p/aspnet-slides.html

All Dot Net and SQL Server Tutorials in English
www.youtube.com/user/kudvenkat/playlists

All Dot Net and SQL Server Tutorials in Arabic
www.youtube.com/c/KudvenkatArabic/playlists

In this video we will discuss about ValidationGroups and CausesValidation property.

The first problem here is that, when I click the Clear button, Form validation still happens. When I click the clear button, I just want to clear the textboxes in the Registration section. Validations doesn't make any sense here. So, how do I prevent validation from happening?
Just, set the CausesValidation property of the button control to false.

The second problem, is that when I click the Login button, only fields in the Login section(UserName and Password) needs to be validated. Along the same lines when I click the "Register" button, only fields in the Registration section(Email, UserName, Password and ConfirmPassword) needs to validated. If we don't use validation groups, then by default, whenever, you click a button, all the validation controls on the page get validated.

So, when you click the login button, and if you want only, the fields in the Login section(UserName and Password) to be validated, then set, the ValidationGroup property of the validation controls and the login button control to the same group name. Use a different group name for the validation controls and register button, in the registration section.
Customize Your Hybrid Embed Video Player!

6-digit hexadecimal color code without # symbol.

 

Report video function is under development.

 


Loading related videos...