In MVC project HttpContext.IsPostNotification is false when
<compilation debug="false" targetFramework="4.5" />
HttpContext.IsPostNotification is true when
<compilation debug="true" targetFramework="4.5" />
My controller "HomeController.cs"
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace Learning.Controllers
{
public class HomeController : Controller
{
public ActionResult Index()
{
ViewBag.Message = "Modify this template to jump-start your ASP.NET MVC application.";
ViewBag.PostNotification = HttpContext.IsPostNotification;
return View();
}
}
}
My View "Index.cshtml"
@{
ViewBag.Title = "Home Page";
}
@ViewBag.PostNotification
MVC application runs in Windows Server (developing in Windows 7), IIS7 Integrated Pipeline mode.
I want to move my application to production, but HttpContext.IsPostnotification is false when set to
<compilation debug="false" targetFramework="4.5" />