Whenever I try to upload a file to a server the current View is redirected to a different View from the controller. How can I upload a file and stay on the same View.
I have tried the following code:
public Action Result(HttpPostedFileBase file)
{
return new EmptyResult();
}
Should work as you’d expect, returning the View named Result.
If the current Action Method isn’t the view you’d like to return you can use: