Here is the code snippet I wrote:
$(function () {
$("input#Submit1").on('click', function () {
$.ajax({
url: 'Home/GetPort',
method: 'GET'
});
alert("test");
});
});
I included an alert to verify the click event. Interestingly, it only works when the alert is present.