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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T15:43:28+00:00 2026-05-13T15:43:28+00:00

I am using C# for my programming. I am facing issue, that my hidden

  • 0

I am using C# for my programming.

I am facing issue, that my hidden variable value is not being updated when it is in update panel. Please see below code for aspx:

<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
        <asp:Timer ID="Timer1" runat="server" Interval="10000" OnTick="Timer1_Tick">
        </asp:Timer>
        <input type="hidden" runat="server" id="hidCurrentDate" value="" />
        <input type="hidden" runat="server" id="hidTripIds" value="" />
        <input type="hidden" runat="server" id="hidTripDetails" value="" />

<asp:UpdateProgress ID="uprogTrips" runat="server">
            <ProgressTemplate>
                <span style="display: block; text-align: center">
                    <p style="font-family: Verdana; font-size: larger; font-weight: bold;">
                        <img src="../../Images/ajax-loader.gif" alt="Processing..." /><br />
                        <br />
                        Processing...</p>
                </span>
            </ProgressTemplate>
        </asp:UpdateProgress>
        <asp:UpdatePanel ID="upTripsGrid" runat="server" UpdateMode="Always">
            <ContentTemplate>
                <asp:GridView ID="gvAllTrips" runat="server" OnRowDataBound="gvAllTrips_RowDataBound"
                    OnPageIndexChanging="gvAllTrips_PageIndexChanging" AllowPaging="true" AutoGenerateColumns="false">
                    <PagerSettings Mode="NumericFirstLast" PageButtonCount="35" Position="TopAndBottom" />
                    <PagerStyle CssClass="GridPager" />                    
                </asp:GridView>
            </ContentTemplate>
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" />
                <asp:AsyncPostBackTrigger ControlID="ddSortBy" EventName="SelectedIndexChanged" />
                <asp:AsyncPostBackTrigger ControlID="ddFilterBy" EventName="SelectedIndexChanged" />
                <asp:AsyncPostBackTrigger ControlID="cbPageOptions" EventName="CheckedChanged" />
            </Triggers>
</asp:UpdatePanel>

and below is the code where I am trying to update one of the hidden field with my CS code.

Interesting, when I am trying to debug its showing all the values, however when I see it f on page source it doesn’t give any value.

Here is my aspx.cs code:

protected void Timer1_Tick(object sender, EventArgs e)
{
    DataTable dtTrips = null;
    WEX.Prototype.Data.TripDA tripDA = new WEX.Prototype.Data.TripDA();
    string tID = hidTripIds.Value;
    string[] tripIDs = new string[1000];
    tripIDs = tID.Split(',');


    foreach (string tripID in tripIDs)
    {
        TripSummaryBO tripSummaryBO = tripDA.getTripSummary(Convert.ToInt32(tripID));
        if (tripSummaryBO.tripLastEditedOnDate > Convert.ToDateTime(hidCurrentDate.Value))
        {

            WEX.Prototype.Service.WSProxies WSProxies = new WEX.Prototype.Service.WSProxies();
            dtTrips = WSProxies.Build();
            Session["AllTrips"] = dtTrips;
            dtTrips = (DataTable)Session["AllTrips"];
            if (dtTrips != null)
            {
                if (cnt==0)
                {
                    hidTripDetails.Value = ("Trip name-" + tripSummaryBO.tripName + " was modified by user " + tripSummaryBO.tripLastEditedBy);
                }
                else
                {
                    hidTripDetails.Value = hidTripDetails.Value + " <br/> " + ("Trip name-" + tripSummaryBO.tripName + " was modified by user " + tripSummaryBO.tripLastEditedBy);
                }
                BuildGridViewControl(dtTrips);
                cnt = cnt + 1;
            }
        }
        else
        {
            //upTripsGrid.Triggers.Clear();
            PageInit();
        }            
    }
}

Please suggest

Thanks.

  • 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-05-13T15:43:28+00:00Added an answer on May 13, 2026 at 3:43 pm

    Your hidden input fields are not within the update panel control. Any asynchronous round trips to the server will cause only those controls within the UpdatePanel itself to update on the UI, so even though the code-behind runs and updates the hidden fields, on the front end they stay the same because they sit outside the panel.

    Try moving the hidden fields within the <ContentTemplate> tag:

    <asp:UpdatePanel ID="upTripsGrid" runat="server" UpdateMode="Always">
        <ContentTemplate>
            <input type="hidden" runat="server" id="hidCurrentDate" value="" />
            <input type="hidden" runat="server" id="hidTripIds" value="" />
            <input type="hidden" runat="server" id="hidTripDetails" value="" />
            ....
        </ContentTemplate>
    </asp:UpdatePanel>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 385k
  • Answers 385k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer That's a problem caused by the closure in the for… May 14, 2026 at 11:27 pm
  • Editorial Team
    Editorial Team added an answer Your best option is to inject the services into the… May 14, 2026 at 11:27 pm
  • Editorial Team
    Editorial Team added an answer I've been able to reproduce your problem. In the WPF… May 14, 2026 at 11:27 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.