Wrox Programmer Forums
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics 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 November 22nd, 2005, 07:46 PM
Authorized User
Join Date: Nov 2005
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default RequiredFieldValidator


I am using a requiredfieldvalidator on a datagrid (Visual studio 2003) on both an edititemtemplate and a footertemplate
I have the following problem
  if i edit a record in the grid and then hit update the requiredfieldvalidator displays error message for the text boxes intended for adding a row. It also kicks in if i click on the heading to sort the column. This would be because it is placed inside the footertenmplate tag. Is there a check to only enforce the validation to kick while we are trying to add a record or is this validation best placed in the ItemCommand event?



Old November 23rd, 2005, 03:11 PM
Friend of Wrox
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts

   Basically only show the footer if the user intends to add a row. Have a separate button "Add". Then in the ItemDataBound event, check if it is the Footer row and check if the "Add" button was clicked. If both are TRUE, then show the footer.

Similar Threads
Thread Thread Starter Forum Replies Last Post
RequiredFieldValidator Control bnorg ASP.NET 1.0 and 1.1 Basics 1 May 3rd, 2006 04:44 PM
RequiredFieldValidator bnorg ASP.NET 1.0 and 1.1 Basics 3 April 24th, 2006 10:00 PM
RequiredFieldValidator g2000 ASP.NET 2.0 Basics 1 December 22nd, 2005 06:23 PM
requiredfieldvalidator suzila ASP.NET 1.0 and 1.1 Basics 5 January 9th, 2004 08:19 AM

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