Hi guys, basically i have mvc kendo ui application. where i have two kendo ui datetimepicker wrappers. What i want to do is on pageload of the grid i would like to flag boolean variable with "true". if true value means its on pageload. So based on the true value i do something like this on the date filters below...
public JsonResult GetIncidents([DataSourceRequest]DataSourceRequest request, int? AccountID, int? SiteID, int? StatusID, int? AuditID, DateTime DateFrom, DateTime EndDate, bool isPageLoaded)
{
using (var db = new IntelligentThinkingACSAEntities())
{
DateTime startDate = DateTime.Now;
if (isPageLoaded)
{
startDate = DateFrom.AddDays(-10);
// DateTime endDate = DateTo.AddDays(-10);
}
else
{
startDate = DateFrom;
}
if its not pageload it will not filter data based on the ten days back date
im passing parametes like these below...
function IncidentsFilter() {
return {
AccountID: $("#KAirports").val() === "" ? 0 : $("#KAirports").val(),
SiteID: $("#KSite").val() === "" ? 0 : $("#KSite").val(),
StatusID: $("#KStatusFilter").val() === "" ? 0 : $("#KStatusFilter").val(),
AuditID: $("#KAuditS").val() === "" ? 0 : $("#KAuditS").val(),
DateFrom: $("#KDateFrom").val() === "" ? new Date : $("#KDateFrom").val(),
EndDate: $("#KDateTo").val() === "" ? new Date : $("#KDateTo").val(),
isPageLoaded: true
};
}
Please help guys, Im stuck