Problems with gridview

Feb 5, 2010 at 12:47 PM

I had a problem with this control using an ASP.NET 3.5 gridview.  I'm using the extender with Version 3.0.30512.1 of the Ajax Control Toolkit.  Although it worked fine for my edit template, it failed for the footer template. 

The cause of the problem in the footer might be related to TargetLabelID.  At first,  I tried using the item template label as I successfully did in the edit template.  That produced a runtime error.  So, I created a hidden label in the footer template.   No error but it didn't work at runtime.  Here's my code:

<asp:TemplateField HeaderText="Last Name" SortExpression="Last_Name">
                     <EditItemTemplate>
                        <asp:TextBox ID="txtLastName" runat="server" Text='' Columns="10" MaxLength="50"></asp:TextBox>
                        <act:FilteredTextBoxExtender ID="txtLastName_Edit_FilteredTextBoxExtender" FilterType="LowercaseLetters, UppercaseLetters, Custom"
                           runat="server" Enabled="True" TargetControlID="txtLastName" ValidChars=" '-">
                        </act:FilteredTextBoxExtender>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator_Last_Name_Edit"
                           runat="server" ControlToValidate="txtLastName" />
                           <val:RequiredFieldExtender ID="RequiredFieldExtender1" runat="server" TargetControlID="RequiredFieldValidator_Last_Name_Edit" TargetLabelID="lblLastName" InvalidLabelCssClass="invalidlabel" InvalidTextBoxCssClass="invalidtextbox" />
                        </EditItemTemplate>
                     <ItemTemplate>
                        <asp:Label ID="lblLastName" runat="server" Text=''></asp:Label>
                     </ItemTemplate>
                     <FooterTemplate>
                        <asp:TextBox ID="txtNewLastName" runat="server" Text='' Columns="10" MaxLength="50"></asp:TextBox>
                        <act:FilteredTextBoxExtender ID="txtNewLastName_Footer_FilteredTextBoxExtender" FilterType="LowercaseLetters, UppercaseLetters, Custom"
                           runat="server" Enabled="True" TargetControlID="txtNewLastName" ValidChars=" -'">
                        </act:FilteredTextBoxExtender>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator_LastName_Footer" runat="server"
                           ControlToValidate="txtNewLastName" />
                        <asp:Label ID="labelLastNameFooterHidden" runat="server" Visible="False"></asp:Label>
                         <val:RequiredFieldExtender ID="rfe_last_name" runat="server" TargetControlID="RequiredFieldValidator_LastName_Footer" TargetLabelID="labelLastNameFooterHidden"
InvalidLabelCssClass="invalidlabel"  InvalidTextBoxCssClass="invalidtextbox" />  
                              
                     </FooterTemplate>
                  </asp:TemplateField>