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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T13:19:35+00:00 2026-06-04T13:19:35+00:00

I have added an UpdatePanel to surround a GridView and given it two triggers

  • 0

I have added an UpdatePanel to surround a GridView and given it two triggers which are buttons outside the UpdatePanel. I cannot get the button click events to trigger the GridView to refresh asynchronously.

I’m sure the datasource is being updated because an F5 page refresh shows the new data (which is submitted through a textfield)

I’ve also tried programmatically updating the UpdatePanel in the code behind file ( UpdatePanel1.Update(); ) but that does not do it either.

Here is my code:

<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
    CodeFile="GamePage.aspx.cs" Inherits="GamePage" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="Server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <span id="userGuess">
        <asp:Label ID="gameStatusLabel" runat="server" CssClass="guesses" Text="15">   
        </asp:Label>
        <asp:Label ID="guessLabel" runat="server" Text="Enter your guess:" 
            CssClass="guessLabel"></asp:Label>
        <asp:TextBox ID="GuessTxtBx" runat="server" MaxLength="4"></asp:TextBox>
        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
            ControlToValidate="GuessTxtBx"
            ErrorMessage="Don't forget to guess!" CssClass="error" Visible="True" 
            Display="Dynamic"></asp:RequiredFieldValidator>
        <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
            ControlToValidate="GuessTxtBx"
            ErrorMessage="Your guess must be a four digit number" 
            ValidationExpression="\d{4}"
            CssClass="error" Visible="True" Display="Dynamic"></asp:RegularExpressionValidator>
        <span class="guessBtns">
            <asp:Button ID="SubmitBtn" runat="server" OnClick="SubmitBtn_Click" 
                Text="Submit Guess"/>
            <asp:Button ID="newGameButton" runat="server" OnClick="newGameButton_Click" 
                Text="New Game" /></span>
    </span>
    <div>
        The game history:<br />
        <br />
        <asp:UpdatePanel ID="UpdatePanel1" runat="server" ChildrenAsTriggers="false" 
                UpdateMode="Conditional">
            <ContentTemplate>
                <asp:GridView ID="TurnGridView" runat="server" AutoGenerateColumns="False" 
                    DataKeyNames="turnID"
                    DataSourceID="TurnsDataSource1" Height="133px" Width="446px" 
                        CssClass="table3">
                    <Columns>
                        <asp:BoundField DataField="turnID" HeaderText="turnID" 
                            InsertVisible="False" ReadOnly="True"
                            SortExpression="turnID" Visible="False" />
                        <asp:BoundField DataField="gameID" HeaderText="gameID" 
                            SortExpression="gameID" Visible="False" />
                        <asp:BoundField DataField="guess" HeaderText="Your Guess" 
                            SortExpression="guess" />
                        <asp:BoundField DataField="responseBulls" HeaderText="Bulls" 
                            SortExpression="responseBulls" />
                        <asp:BoundField DataField="responseCows" HeaderText="Cows" 
                            SortExpression="responseCows" />
                    </Columns>
                </asp:GridView>
                <asp:ObjectDataSource ID="TurnsDataSource1" runat="server" 
                    SelectMethod="GetTurnsByGameID"
                    TypeName="BusinessTier.Turn"   
                    OldValuesParameterFormatString="original_{0}" 
                    onselecting="TurnsDataSource1_Selecting">
                    <SelectParameters>
                        <asp:Parameter Name="gameID" Type="Int32" />
                    </SelectParameters>
                </asp:ObjectDataSource>
            </ContentTemplate>
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="SubmitBtn" EventName="Click"/>
                <asp:AsyncPostBackTrigger ControlID="newGameButton" EventName="Click" />
            </Triggers> 
        </asp:UpdatePanel>
    </div>
</asp:Content>
  • 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-04T13:19:37+00:00Added an answer on June 4, 2026 at 1:19 pm

    You probably got a server side error that is swallowed. To see the error message, the easiest way is to temporary replace your AsyncPostBackTrigger by a PostBackTrigger.

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

Sidebar

Related Questions

I'm trying to have two things happen when I click on a button in
I have added OnClick event dynamically for gridview.So when I click on any of
I have added an EventHandler for the Click-event to a picturebox but on runtime
I have added a new job in my hudson server which builds the project
I have added two update panels to my page. I'm trying to update the
I have a ASP updatepanel, within that panel I have some controls which got
I have a GridView in an UpdatePanel (ASP.Net 2.0) . I have this code
I have added above code in my WPF from which include animated GIF image,
I have a dynamically created button that is being added to an update panel
I have a GridView of thumbnail photos within an UpdatePanel, with clickable icons in

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.