I call the same controller many times from _Layout.cshtml view. So in this controller, how can I discover at runtime if it’s still same page that is rendering or if a brand new page request is being made?
In asp.net you can use ispostback to figure this out. How can you tell if a brand new request is being made for a page in MVC3?
Thanks
There’s no such think on MVC. You’ve actions that can handle POSTs, GETs or both. You can filter what each action can handle using
[HttpPost]and[HttpGet]attributes.On MVC, the closest you can get to
IsPostBackis something like this within your action:Therefore,