How to return a view as well as redirect to another action in MVC [or Return a view and reload the current view]?

I have two actions; First One

 public ActionResult ViewRequests()
        List<AgentRequests> Reqs = con.AgentRequests
                                      .Where(x => x.Status == RequestStatus.Open)
                                      .OrderBy(x => x.RequestedOn).ToList();

        return View(Reqs);

Second One:

 public ActionResult ProcessRequest(long Id)

      // Code to export data to excel file

        //return RedirectToAction("ViewRequests");
        return View(KnoqedUsers);

My first action returns a view having a list. Each row of this list is having a link - "Process Request", which when clicked calls the second action.

My second action will produce an excel file output to download.

My problem is - Currently the row which is clicked is processed. So I need to remove it from my view.

If I manually reload the page its OK. But how can I automatically reload it?

I cannot use 2 return statements as shown in my second code. How can I achieve this?


You can't. This is fundamentally not how the Internet works. One of the overriding principles of the Internet is what's called request-response. In other words, a request gets one response and a response only follows a request. The client makes a request to a server, and that server returns a response to the client. A view (HTML) is a response and a redirect is also a response. Therefore, you cannot possibly return both, only one or the other. Likewise, you cannot return an HTML response and then return the HTML response again, without the client first replaying the request.


 ? Visual Studio does not deploy ASP.NET Core views when they are in an area
 ? Date formatting in MVC view
 ? How to localize structures HTML views in ASP.NET?
 ? Can a HTML hidden variable be seen or changed by an end user?
 ? using the same partial view with different buttons
 ? How to access data from query without a model in ASP.NET 5 MVC
 ? How to configure additional classpath in SpringBoot?
 ? Make the browser wait for api response / http call response in angularjs
 ? How to access the correct `this` context inside a callback?
 ? Node Q - handle array with Q