Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8787661
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T21:56:45+00:00 2026-06-13T21:56:45+00:00

I have text box and a button in a gridview. The textbox has validation

  • 0

I have text box and a button in a gridview. The textbox has validation when the button is clicked. However the validation event never gets fired when the button is clicked a second time.

<asp:GridView ID="ChapterGridView" 
               EnableSortingAndPagingCallbacks="false" 
               AllowSorting="false" 
               AllowPaging="false" 
               runat="server"                            
               AutoGenerateColumns="False" 
               CellPadding="2" 
               ForeColor="#333333"
               GridLines="None"  
               Width="780px" 
               OnRowCommand="ChapterGridView_OnRowCommand" 
               ShowFooter="False" 
               AutoGenerateDeleteButton="true"
               AutoGenerateEditButton="true"
               onrowediting="ChapterGridView_RowEditing"
               onrowdeleting="ChapterGridView_RowDeleting" 
               onrowcancelingedit="ChapterGridView_RowCancelingEdit" 
               onrowupdating="ChapterGridView_RowUpdating"
               onrowupdated="ChapterGridView_RowUpdated"
               DataKeyNames="ChapterId"
               ValidationGroup="ChapterValidation"
               Visible="true">
            <FooterStyle BackColor="#eeeeee" Font-Bold="True" ForeColor="White" />
            <Columns>
                <asp:TemplateField HeaderText="*End Page" HeaderStyle-HorizontalAlign="Left">
                    <ItemTemplate><%# Eval("EndPage")%></ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="EndPage" runat="Server" Text='<%# Eval("EndPage") %>'></asp:TextBox>
                        <asp:CustomValidator ID="TotalPagesValidator" ValidationGroup="ChapterValidation" OnServerValidate="TotalPages_ServerValidate" EnableClientScript="false" ErrorMessage="Number of pages in chapter are greater than number of pages in entire publication." Display="None" ControlToValidate="EndPage" runat="server" />
                    </EditItemTemplate>
                    <FooterTemplate>
                        <asp:TextBox ID="EndPage" runat="Server"></asp:TextBox>
                        <asp:CustomValidator ID="TotalPagesValidator2" ValidationGroup="ChapterValidation" OnServerValidate="TotalPages_ServerValidate" EnableClientScript="false" ErrorMessage="Number of pages in chapter are greater than number of pages in entire publication." Display="None" ControlToValidate="EndPage" runat="server" />

                        <asp:Button ID="btnInsert" runat="Server" Text="Insert" CommandName="Insert" UseSubmitBehavior="false" ValidationGroup="ChapterValidation" /></span>
                    </FooterTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>

The same validation for edit works as expected. But not for the Insert button. Any suggestions?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T21:56:47+00:00Added an answer on June 13, 2026 at 9:56 pm

    @TrekStir – thanks for pointing me in the right direction.

    The problem was that there was code to make the footer invisible after a row was added. For some reason that was causing the validation code not to fire. I figured out a way to implement the functionality without setting the footer to invisible and this solved the problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have event Button that creates text box in run time. Private Sub Button1_Click(ByVal
Greetings, In my current project, I have gridview, search button, text box for search,
How to apply textbox blank validation on button click inside gridview in javascript?I have
I have a text box and a button, if I enter some text in
I have a UI with a search text box and a button that that
I have a button next to a text box and when I click the
I have 2 textBox and 1 button! I want to insert text to one
I have a TextBox, GridView and Button such as txtCount, gvCount and btnCount. The
i have an gridview control with a comment text, link button, and an invisible
Lets say we have a textbox and an button. And the user write table

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.