I am developing MVC Web application.
I use HttpPost via form.submit to request all views except first/default view.
Therefore url in browser's address bar does not change i.e. stays http://mymachine:62846
When I try window.location.reload(true) url becomes http://mymachine:62846/Home/GetPartialView
and web browser displays error:
Server Error in '/' Application. The resource cannot be found. Description: HTTP 404. Requested URL: /Home/GetPartialView
in HomeController
Method GetPartialView
is marked HttpPost
:
[HttpPost]
public ActionResult GetPartialView(BroadcastedData data)
Based on aforementioned error my understanding is when window.location.reload(true)
is executed browser sends HttpGet
request or HttpPost
w/o post data and server can't route request properly.
Am I wrong?
How can I reload page via code properly essentially mimicking user pressing CTRL + R? Thank you.