I have an input type=\"button\"
Use the @Url.Action method. This will work and determines the correct route regardless of what IIS server you deploy to.
Example- window.location.href="@Url.Action("Action", "Controller")";
so in the case of the Index action on the Home controller - window.location.href="@Url.Action("Index", "Home")";
Maybe better to make an anchor with DeleteJob url instead of button?
<a href="<%=Url.Action("DeleteJob", "YourController", new {selectedObject="someObject"})%>" onclick="return DeleteJob()">Löschen</a>
and use your javascript you wrote already:
function DeleteJob() {
if (confirm("Do you really want to delete selected job/s?"))
return true;
else
return false;
}
So if function return true - you will be redirected. If function return false - you still stay on the page.