Child actions are not allowed to perform redirect actions, after setting the site on HTTPS [duplicate]

This means that:

  1. the action corresponding to the URL has been processed and a view result has been returned.
  2. ASP.NET MVC’s view engine has started rendering the view, possibly sending headers and part of the HTML to the browser.
  3. the view engine has come across a RenderAction(…) call and has started executing the action.
  4. the action has tried to return a Redirect HTTP status code to the browser

At this point, ASP.NET is at a loss: it has already started sending headers and HTML to the client, but now it is suddenly told to recall all that and instead send a redirect status code. It obviously cannot do that, so it throws an exception.

You will have to figure out why a redirect is being triggered and make sure that that does not happen. The most likely cause (but by no means the only possible cause) is some custom action filter that hasn’t been designed to take child actions into account. ASP.NET MVCs action filters typically check whether the executing action has been called as a child action and avoid redirects in such scenarios.

Leave a Comment