public ActionResult DefaultView() {
LoadPage();
if (_page != null && _page.ThePage.Root_ContentID != Guid.Empty) {
DateTime dtModified = _page.TheSite.ConvertSiteTimeToLocalServer(_page.ThePage.EditDate);
string strModifed = dtModified.ToString("r");
Response.AppendHeader("Last-Modified", strModifed);
Response.Cache.SetLastModified(dtModified);
DateTime dtExpire = DateTime.Now.AddSeconds(15);
if (User.Identity.IsAuthenticated) {
Response.Cache.SetNoServerCaching();
Response.Cache.SetCacheability(HttpCacheability.NoCache);
dtExpire = DateTime.Now.AddMinutes(-10);
Response.Cache.SetExpires(dtExpire);
} else {
Response.Cache.SetExpires(dtExpire);
}
SiteData.WriteDebugException("cmscontentcontroller_defaultview _page != null", new Exception(String.Format("Loading: {0} {1} {2}", _page.ThePage.FileName, _page.ThePage.TemplateFile, this.DisplayTemplateFile)));
return View(this.DisplayTemplateFile);
} else {
string sFileRequested = Request.Path;
SiteData.WriteDebugException("cmscontentcontroller_defaultview _page == null", new Exception(String.Format("Requesting: {0} {1}", sFileRequested, this.DisplayTemplateFile)));
DateTime dtModified = DateTime.Now.Date;
string strModifed = dtModified.ToString("r");
Response.AppendHeader("Last-Modified", strModifed);
Response.Cache.SetLastModified(dtModified);
Response.Cache.SetExpires(DateTime.Now.AddSeconds(30));
if (SiteData.IsLikelyHomePage(sFileRequested)) {
SiteData.WriteDebugException("cmscontentcontroller_defaultview", new Exception("Empty _page"));
return View("_EmptyHome");
} else {
Response.StatusCode = 404;
Response.AppendHeader("Status", "HTTP/1.1 404 Object Not Found");
SiteData.WriteDebugException("cmscontentcontroller_httpnotfound", new Exception("HttpNotFound"));
return HttpNotFound();
}
}
}