I have a cshtml under Shared folder. I am doing a RedirectToAction() to this page but its not looking for this file in Shared folder. Its only looking in the appropriate folder under views. It uses to look into Shared folder before and I have no idea what I could have changed that breaking lookup. Any ideas?
I have a cshtml under Shared folder. I am doing a RedirectToAction() to this
Share
You cannot do a
RedirectToActionto a view. You are doing (as it name suggests) a redirect to an action. It is this action that returns a view. By default it will look for views in the~/Views/ControllerNameand~/Views/Shared. So let’s suppose that you have the following action which performs a redirect:which would redirect to the
Indexaction on theProductscontroller:Now the Index.cshtml view could be in
~/Views/Products/Index.cshtmlor in~/Views/Shared/Index.cshtml.