Child actions are not allowed to perform redirect actions asp.net mvc error

Quesiton:

I am getting following error, while redirect in asp.net mvc

Child actions are not allowed to perform redirect actions asp.net mvc

By  Junaid A    01-Dec-2023    2

Solutions


Nawab

Try to return 

return PartialView(...) 

instead on Return View()

Junaid A

Error is:

Server Error in '/' Application.


Child actions are not allowed to perform redirect actions.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.InvalidOperationException: Child actions are not allowed to perform redirect actions.

Source Error: 
 

Line 903:                        <div class="header-top"></div>
Line 904:                        @{
Line 905:                        Html.RenderAction("_header", "Home");
Line 906:                        }
Line 907:                    </div>

Your Answer

10121