I have a menu which redirects to different url
one of them is a different project but within the same domain.
Main project (myDomain.com.mx/MenuApps/Index)
Menu
//mas código como este
<div class="col-xs-6 col-sm-3 col-md-2">
<div class="contact-box">
<!-- /Nuevo se sustituye por /BuzonFiscal -->
<a href="#">
<div class="col-sm-12">
<div class="text-center">
<img alt="image" class="m-t-xs img-responsive" src="~/img/admix_logo_colibri.png">
<div class="m-t-xs font-bold">Buzon Fiscal</div>
</div>
</div>
<div class="clearfix"></div>
</a>
</div>
</div>
//mas código como este
in script
it I have this where I make my requestajax
$.ajax({
data: "Dato_en_MD5",
url: '/BuzonFiscal',
type: 'post',
success: function (response) {
console.log(response)
}
});
As far as I understand this ajax
will not do the redirection to the url
, what I need is to redirect and send the hidden data.
Fiscal Mailbox (miDominio.com.mx/BuzonFiscal)
this is the fiscal mailbox controller :
namespace Emisiones.Controllers
{
public class HomeController : Controller
{
[HttpPost]
public ActionResult Empresas(string dato_en_MD5)
{
//.. lo que tenga que hacer
return View();
}
}
}
So how can I redirect to miDominio.com.mx/BuzonFiscal
sending two data by post
?
why don't you make a post request from the html?
from your JS you load the value to the hidden input and submit the post form.
To send two or more data you can serialize them in json format and receive them in the Controller by reading the content of the request:
Petition:
Controller accompanied by a class to deserialize to that class:
class
Datos
: