I have a button on a site that should - if clicked - pass some data to the controller and redirect to another view. I tried it with AJAX and realized it doesn't work, because it cannot redirect to another view.
I read some posts that suggested using JavaScript, but there wasn't one where a model is passed to the View as well (Propably I'm just dumb...).
Right now it looks like this:
function buttonClick() {
$.ajax({
type: 'POST',
url: '/Backup/Timestamp',
data: {iniName: selectedFile}
});
}
public ActionResult Timestamp(string iniName)
{
//some code
return View(Model);
}
Thanks for your help!