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 9210763
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:09:02+00:00 2026-06-18T01:09:02+00:00

Code excerpt: <asp:UpdatePanel runat=server ChildrenAsTriggers=true> <ContentTemplate> <asp:ValidationSummary runat=server DisplayMode=List /> <asp:GridView ID=MyGridView runat=server AllowPaging=true

  • 0

Code excerpt:

<asp:UpdatePanel runat="server" ChildrenAsTriggers="true">
<ContentTemplate>

    <asp:ValidationSummary runat="server" DisplayMode="List" />

    <asp:GridView ID="MyGridView" runat="server" AllowPaging="true" AllowSorting="true"
            DataKeyNames="itemId"
            OnRowDataBound="MyGridView_RowDataBound"
            onPageIndexChanging="MyGridView_PageIndexChanging"
            onSorting="MyGridView_Sorting"
            OnRowEditing="MyGridView_RowEditing"
            OnRowCancelingEdit="MyGridView_RowCancelingEdit"
            OnRowUpdating="MyGridView_RowUpdating"
            OnRowDeleting="MyGridView_RowDeleting"
            OnRowCommand="MyGridView_RowCommand"
            AutoGenerateColumns="false"
            onSelectedIndexChanged="MyGridView_SelectedIndexChanged"
            CssClass="adminTable">

            <Columns>
               <asp:TemplateField HeaderText="Name" SortExpression="name">
                    <EditItemTemplate>
                        <asp:TextBox ID="editName" runat="server" Text='<%# Bind("name") %>' />
                        <asp:RequiredFieldValidator runat="server" ControlToValidate="editName"
                            ErrorMessage="Please enter a Name" Display="None" />
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="name" runat="server" Text='<%# Bind("name") %>' />
                    </ItemTemplate>
                    <FooterTemplate>
                        <asp:TextBox ID="newName" runat="server" />
                        <asp:RequiredFieldValidator runat="server" ControlToValidate="newName"
                            ErrorMessage="Please enter a Name" Display="None" />
                    </FooterTemplate>
                </asp:TemplateField>

                <%-- Some additional Similar Templates here --%>

                <asp:TemplateField>
                    <EditItemTemplate>
                        <asp:LinkButton ID="linkUpdate" runat="server" CausesValidation="true"
                            CommandName="Update" Text="Save" />
                        <asp:LinkButton ID="linkCancel" runat="server" CausesValidation="false"
                            CommandName="Cancel" Text="Cancel" />
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:LinkButton ID="linkEdit" runat="server" CausesValidation="false"
                            CommandName="Edit" Text="Edit" />
                        <asp:LinkButton ID="linkDelete" runat="server" CausesValidation="false"
                            CommandName="Delete" Text="Delete"
                            OnClientClick="return confirmDelete();" />
                    </ItemTemplate>
                    <FooterTemplate>
                        <asp:LinkButton ID="linkUpdate" runat="server" CausesValidation="true"
                            CommandName="Insert" Text="Save" />
                        <asp:LinkButton ID="linkCancel" runat="server" CausesValidation="false"
                            CommandName="Cancel" Text="Cancel" />
                    </FooterTemplate>
                </asp:TemplateField>
            </Columns>
            <pagersettings mode="Numeric" position="Top" pagebuttoncount="10" />
            <pagerstyle height="30px" verticalalign="Top" horizontalalign="Right" />
    </asp:GridView>

    <asp:LinkButton ID="LinkAdd" runat="server" OnClick="LinkAdd_OnClick" Text="Add"
        CausesValidation="false" />

</ContentTemplate>
 </asp:UpdatePanel>

Scenario:

Click the Edit button in any row. The Code-behind OnRowEditing sets MyGridView.EditIndex = e.NewEditIndex; and a couple other small tasks. Edit the Name feild to be blank. Click to save in that row. The appropriate message appears at the top with the validation summary. Now click to Cancel in that row. Nothing happens. Click any
other button anywhere (sort, page, edit in a different row, etc.). Nothing happens.

Everything works as long as all fields stay valid. Also, after the invalid submit, it is possible to type in the edit feild(s), but this does not change the outcomes.

Break points in the various event handlers (i.e. OnRowCancelingEdit, OnRowCommand, OnRowDeleting, etc) shows that no calls are getting to code-behind.

When the GridView is NOT inside an UpdatePanel, everything works as expected. However, it is desired to have these in UpdatePanel so that the page will not “flash” or every page, sort, or edit.

Things tried:

  • Changing UpdateMode of the UpdatePanel to both Always and
    Conditional.
  • Removing ChildrenAsTriggers
  • 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-18T01:09:04+00:00Added an answer on June 18, 2026 at 1:09 am

    I got the answer for this from someone outside of SO, and I feel awkward claiming this as my own answer. But if it helps others, I feel I should present it here.

    I had to put all my validators and summaries into ValidationGroups and set all links and buttons to CausesValidation="false". Then, in Code-Behind, at the top of the appropriate methods, call Page.Validate("groupName") and immediately return; if fails. This forces a post-back which re-sets the UpdatePanel.

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

Sidebar

Related Questions

i have an asp,net textbox like this <asp:TextBox readonly=true ID=txtLastService runat=server></asp:TextBox> when i tried
My code behind is VB.NET. I use ASP.NET UpdatePanel like the following. However, after
I have a new server with the same Classic ASP code connecting to same
this code is a excerpt from the book asp.net all in one reference for
Here is a code excerpt from AspComet project that works with Autofac. public MessageBus(IClientRepository
Here is an excerpt from my code: xtype: 'image', src: 'http://www.sencha.com/files/blog/old/blog/wp-content/uploads/2010/06/sencha-logo.png', left: '50%', top:
This is an excerpt of some c++ code, that i'll have to explain in
The ASP code below grabs the content of a file (thisoutfile - which has
Setup: IIS7 serving ASP classic VB script code which generates a dynamic VSC page/file
I am trying to put some jquery UI code into an existing asp.net app,

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.