How to navigate to a URL on an empty link click
I am writing an MVC ASP.NET based website, and I want to create a ActionLink that deletes the current entity. For search engine reasons, I don't want this link to be able to be followed (else all my data is gone!), unless a user, via jQuery, confirms the action. For the confirmation, I can use something like:
[html]
<a href="" id="delete">Delete this entity</a>
[js]
$( function() {
$('#delete').click(function() {
return confirm('Confirm Delete?');
});
});
but I am not sure how to follow a URL once the confirmation is done. What I would like to do is something like this:
$( function() {
$('#delete').click(function() {
if (confirm('Confirm Delete?')) {
GoToUrl('someURL');
}
});
});
What is the best way to do this? Should I submit a form or is there a navigate method that I missed?
Thanks!
Erick