ASP.NET 1.0 and 1.1 BasicsASP.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
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?
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.