I have a link to perform some ajex function.
<td title="address/list" class="link">Addresses</td>
<td title="email/list" class="link">Email</td>
<td title="phone/list" class="link">Phone Numbers</td>
<td title="contact/edit" class="link">Edit</td>
<td title="contact/delete" class="link">Delete</td>
javascript code
$('.link').live('click', function(event) {
var id = $.trim($('td:first', $(this).parents('tr')).text());
var loc = $(this).attr('title');
console.log(loc);
// check to ensure the link is not a delete link
if (loc.lastIndexOf('delete') == -1) {
$.get(loc + '/' + id, function(data) {
$('#details').html(data);
});
// if it is, show the modal dialog
} else {
$('#dialog').dialog({
buttons: {
'Confirm': function() {
window.location.href = loc + '/' + id;
},
'Cancel': function() {
$(this).dialog('close');
}
}
});
$('#dialog').dialog('open');
}
});

my routing is like
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
"Default",
"{controller}/{action}/{id}",
new { controller = "Contact", action = "List", id = "" }
);
}