Based on Calling ASP.NET MVC Action Methods from JavaScript I've attempted to update a cookie message using ASP.NET Core by :
replacing
hrefbywindow.location.hrefandspecifying
ActionName+ControllerName.I've also tried
window.location.href = '@Url.Action("Action", "Controller")
[Problem] : When clicking on the link, 1-3 redirect to https://www.cookiesandyou.com/, instead of https://localhost/ControllerName/ActionName . Please see below a sample code:
window.cookieconsent.initialise({
....
},
"showLink": true,
"content": {
"message": "test ",
"window.location.href": "Dat?Home",
"allow": "Allow"
}
});
Any idea would highly be appreciated.
N.B: Using ASP.NET, this tasks was trivial since href was simply pointing to /Dat.
Best