Through ajax call am calling GetBlinkStatus(startdate,enddate) at page load,
function getBlink(){
var strtDate = document.newGetElementById('hidStrtDate').value;
var endDate = document.newGetElementById('hidEndDate').value;
Application_Home_Admin.GetBlinkStatus(strtDate, endDate , getData_callback);
}
Server side code, changing hidden value on drop down change
if (index == 0)
{
fromDate = DateTime.Now.ToString(CommonSessions.CorporateDateFormat);
toDate = DateTime.Now.ToString(CommonSessions.CorporateDateFormat);
lblCurrentFilter.Text = GetResourceValue(ResourceFiles.DefaultLocal, "Scheduleson") + " " + GetFormattedDate(DateTime.Now);
<code> hidStrtDate.Value = Convert.ToString(DateTime.Now);
hidEndDate.Value = Convert.ToString(DateTime.Now);</code>
}
else if (index == 1)
{
fromDate = currentFirstDay.ToString(CommonSessions.CorporateDateFormat);
toDate = endDate.ToString(CommonSessions.CorporateDateFormat);
lblCurrentFilter.Text = GetResourceValue(ResourceFiles.DefaultLocal, "Schedulesfrom") + " " + GetFormattedDate(currentFirstDay) + " " + GetResourceValue(ResourceFiles.Default, "To") + " " + GetFormattedDate(endDate);
<code>hidStrtDate.Value = Convert.ToString(currentFirstDay);
hidEndDate.Value = Convert.ToString(endDate);</code>
}
Ajax method in server side
[AjaxPro.AjaxMethod(AjaxPro.HttpSessionStateRequirement.Read)]
public int GetBlinkStatus(string strtDate,string endDate)
{
int returnVal = -1;
returnVal = Obj.GetBlinkStatusByDate(Convert.ToDateTime(strtDate), Convert.ToDateTime(endDate));
return returnVal;
}
Initially am passing parameters from Hidden field, so no problem in it.
But when I change hidden field value in server side, older values still persist and passed as parameter to the ajax call.
How can I overcome this issue?
Any helps will be greatly appreciated.
Regards,
RK