Problem – any hidden field in Update Panel does not get upda

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: Processing… OnPageIndexChanging=”gvAllTrips_PageIndexChanging” AllowPaging=”true” AutoGenerateColumns=”false”> and below is the code where I am trying to update one of the hidden field with my CS code….

via Asp.Net Developed Tutorials » Search Results » ajax:

Problem – any hidden field in Update Panel does not get upda

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:







Processing...

Processing…






OnPageIndexChanging=”gvAllTrips_PageIndexChanging” AllowPaging=”true” AutoGenerateColumns=”false”>










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 + ”
” + (“Trip name-” + tripSummaryBO.tripName + ” was modified by user ” + tripSummaryBO.tripLastEditedBy);

BuildGridViewControl(dtTrips);
cnt = cnt + 1;
}
}
else

//upTripsGrid.Triggers.Clear();
PageInit();

}
}Please suggest
Thanks.
……………………………….

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 tag:





….

For more info: Problem – any hidden field in Update Panel does not get upda

Asp.Net Developed Tutorials » Search Results » ajax

Problem – any hidden field in Update Panel does not get upda

Share this post:

Related Posts

Leave a Comment