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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T03:04:16+00:00 2026-06-05T03:04:16+00:00

I have a repeater in an UpdatePanel and when I add some text and

  • 0

I have a repeater in an UpdatePanel and when I add some text and submit a button, the update does not appear immediately, but only after I submit the button a second time.

Any thoughts as to why this is happening?

Thanks.

 <asp:UpdatePanel ID="updateStatus" UpdateMode="Conditional" runat="server">
        <ContentTemplate>
            <table border="">
                <tbody>
                <asp:TextBox Width="520" Height="35" style="font-size:13px;padding-left:0px;padding-right:0px;" id="txtStatusUpdate" runat="server"></asp:TextBox>
                <asp:UpdatePanel ID="updButton" runat="server" UpdateMode="Conditional">
                    <ContentTemplate>
                        <asp:Button style="font-size:25px;padding-left:0px;padding-right:0px;" ID="btnAddStatus" runat="server" Text="Add" OnClick="btnAddStatus_Click" />
                    </ContentTemplate>
                </asp:UpdatePanel>
                <asp:Repeater ID="repFilter" runat="server">
                    <ItemTemplate>
                        <tr>
                            <td class="date"><%# String.Format("{0:MM/dd/yyy}", ((Alert)Container.DataItem).CreateDate) %></td>
                            <td><%# ((Alert)Container.DataItem).Message  %></td>
                        </tr>
                    </ItemTemplate>
                </asp:Repeater>
                </tbody>
            </table>
        </ContentTemplate>      
        </asp:UpdatePanel>



protected void Page_Load(object sender, EventArgs e)
{

            _presenter = new RespondentProfilePresenter();
            _presenter.Init(this);
}


 protected void btnAddStatus_Click(object sender, EventArgs e)
        {
            StatusUpdate su = new StatusUpdate();
            su.CreateDate = DateTime.Now;
            su.AccountID =  _userSession.CurrentUser.AccountID;
            su.Status = txtStatusUpdate.Text;
            _statusRepository.SaveStatusUpdate(su);
            _alertService.AddStatusUpdateAlert(su);

            updateStatus.Update();

            //_redirector.GoToHomePage();
        }

 public void ShowAlerts(List<Alert> alerts)
        {

            repFilter.DataSource = alerts;
            repFilter.DataBind();

            if (repFilter.Items.Count == 0)
            {
                //lblMessage.Text = "You don't have any alerts yet!";
            }

        }

EDIT EDITEDIT EDITEDIT EDITEDIT EDITEDIT EDITEDIT EDITEDIT EDITEDIT EDITEDIT EDITEDIT EDIT

I have updated the HTML (I have taken out the second UpdatePanel) but am still getting the same results – the most recent update does not post until the second time the button submits.

   <asp:UpdatePanel ID="updateStatus" UpdateMode="Conditional" runat="server">
         <ContentTemplate>
            <asp:TextBox Width="520" Height="35" style="font-size:13px;padding-left:0px;padding-right:0px;" id="txtStatusUpdate" runat="server"></asp:TextBox>
            <asp:Button style="font-size:25px;padding-left:0px;padding-right:0px;" ID="btnAddStatus" runat="server" Text="Add" OnClick="btnAddStatus_Click" />
            <table border="">
                <tbody>
                <asp:Repeater ID="repFilter" runat="server">
                    <ItemTemplate>
                        <tr>
                            <td class="date"><%# String.Format("{0:MM/dd/yyy}", ((Alert)Container.DataItem).CreateDate) %></td>
                            <td><%# ((Alert)Container.DataItem).Message  %></td>
                        </tr>
                    </ItemTemplate>
                </asp:Repeater>
                </tbody>
            </table>
        </ContentTemplate>      
        </asp:UpdatePanel>

  public class RespondentProfilePresenter
    {


     //CODE HERE....
public void Init(IRespondentProfile View)
        {
            _view = View;

            _view.SetAvatar(_accountBeingViewed.AccountID);
            _view.DisplayInfo(_accountBeingViewed);

            if (_userSession.CurrentUser != null)
                ShowDisplay();

            TogglePrivacy();
        }


private void ShowDisplay()
{

    List<Alert> _objAlerts = _alertService.GetAlertsByAccountID(_userSession.CurrentUser.AccountID);

    _view.ShowAlerts(_objAlerts);


}

}
  • 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-05T03:04:17+00:00Added an answer on June 5, 2026 at 3:04 am

    Its a bit hard for me to follow your code, as I dont have your BL classes (Alert, IREspondedProfile etc), so Im going to half guess:

    Within your page load, you call the Init method of the RespondentProfilePresenter class.

    This method calls ShowDisplay, which eventually binds the repeater.

    Notice that this happens BEFORE the event handler of the pressed button is fired, which is the place in code where You update your alerts list.


    Your new alert is added AFTER the data source for the repeater is set, and therefor You only see the update on every other button click. You need to reorder Your code in such way that the DataBind will occur only AFTER the addition of the new alert.

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

Sidebar

Related Questions

I have an UpdatePanel which has a Repeater inside it, and inside of the
I have Repeater Control as shown below. <asp:Repeater ID=rptCategory runat=server> <HeaderTemplate> <h2 class=art-logo-text style=margin-bottom:
I have a Repeater and also a Button . If I click on my
I have a paging repeater inside of an UpdatePanel so that I can show,
I have an UpdatePanel that contains a Repeater. in the ItemTemplate of the repeater
Here's the scenario: I have a repeater inside an UpdatePanel called updPanel. Inside this
I have a repeater I want to add a title to in the HeaderTemplate
I have a repeater in an updatepanel, in the repeater there are several panels.
I have an UpdatePanel in a Repeater. There are a few CheckBoxes in the
I have a repeater, which represents a shoppingbasket. This shopping basket has an Update

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.