I have been developing in ASP.NET MVC for a short while. Up to this point, the controller actions have been fairly simple. Each action returns its corresponding view. However, I recently created an action that I don’t necessarily need a page for (the purpose of the action is to work with the database).
My question is – what is the proper thing to do here. At the end of the method, I return Response.Redirect(‘\Controller\View’), so I go back to another view. Is it possible to not have to return any kind of view at the end of an action? What are the best practices here?
If you need to redirect a user because they clicked a link then redirect a user.
If your posting with Ajax or another technique and there is no meaningful response change the controller action method to have a return type of void.