In my page i have download links to files like Documents,Audio and Video and on click of that download link i want to update hits counter in database for that i use the strategy of jquery ajax request that will update hits counter but the issue is when i click on hyperlink it call the jquery function but doesnt call my controller action and download popups appear. What may be the issue for reference im writing the code
<a att="1" href="../Abc.doc">Download</a>
<a att="2" href="../Abcs.wmv">Download</a>
and in jquery
$('a').click(function () {
var myurl = '<%= Url.Action("UpdateHits", "Media") %>';
var id = $(this).attr('att').toString();
$.ajax({
url: myurl,
type: "POST",
data: { Id: id },
success: function (data) {
alert(data);
}
});
});