Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 4.5 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4.5: in C# and VB by Imar Spaanjaars; ISBN: 978-1-118-31180-6
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4.5 : in C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 18th, 2014, 04:46 PM
Authorized User
 
Join Date: Aug 2014
Posts: 34
Thanks: 3
Thanked 0 Times in 0 Posts
Default Update record vs Required Field Validation

I have an aspx page that has both a GridView and a DetailsView on the same page.

In the DetailsView I have a Required Field Validator for a Template Field control and it works just fine.

However, in the GridView, if I try and Update the same field (name) of a previously entered record and then click on the Update link, the Required Field Validator in the DetailsView "kicks in" indicating that I have left the control in the DetailsView blank. In this case I am not try to add a new record, but merely trying to edit an existing one.

Needless to say, the Update fails.

Once I removed the Required Field Validator in the DetailsView for the control, the Update worked just fine.

Can't I have both?

Thanks you,
Cliff
 
Old December 19th, 2014, 06:14 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

Take a look at the ValidationGroup property of the validation controls: http://msdn.microsoft.com/en-us/libr...vs.110%29.aspx This allows you to create two separate validation groups for the different controls.

Hope this helps,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Finding highest value in field to update record klaidlaw Access VBA 0 February 15th, 2013 03:56 PM
I need help on custom required field validation, reall urgent please ysfkay ASP.NET 3.5 Professionals 7 March 21st, 2009 05:39 AM
Required field dependent on another field... nkrukovsky Access VBA 3 January 14th, 2004 10:37 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.