Asp.NET MVC : redirect to another controller with POST Action

17,628

As you can see here, RedirectToAction returns an HTTP 302 response to the browser, which causes the browser to make a GET request to the specified action.

Redirect and RedirectPermanent will not solve your problem also. The basic difference between them is that RedirectPermanent sends the browser an HTTP 301 (Moved Permanently) status code whereas Redirect will send an HTTP 302 status code.

You are unable to create redirect with POST.

You can use Session for storing and sending data between pages.

Share:
17,628

Related videos on Youtube

AHmedRef
Author by

AHmedRef

I'm a Multi-developper.

Updated on August 23, 2022

Comments

  • AHmedRef
    AHmedRef over 1 year

    My issue is that i want to make redirection to action in another Controller with POST DATA not a GET

    RedirectToAction("GenaraleExportPDF", "ExportController", new { 
    
    screendata = json, monTitre = monTitre, file = file, block1 = block1, block2 = block2, block3 = block3, block4 = block4 
    
    });
    

    this example exaplaine the redirection but on GET Action.