Problem - any hidden field in Update Panel does not get updated
<p>I am using C# for my programming.</p>

<p>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:</p>

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

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

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

<p>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.</p>

<p>Here is my aspx.cs code:</p>

<pre><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 &gt; 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 + " &lt;br/&gt; " + ("Trip name-" + tripSummaryBO.tripName + " was modified by user " + tripSummaryBO.tripLastEditedBy);
                }
                BuildGridViewControl(dtTrips);
                cnt = cnt + 1;
            }
        }
        else
        {
            //upTripsGrid.Triggers.Clear();
            PageInit();
        }            
    }
}
</code></pre>

<p>Please suggest</p>

<p>Thanks.</p>
