I am wondering why this hander fires on both button clicks?
<script type="text/javascript">
$(document).ready("#testbutton").click(function () {
$.ajax({
url: '@Url.Action("RenderBlogComments","Home")',
success: function (data) {
// your data could be a View or Json or what ever you returned in your action method
// parse your data here
alert(data);
}
});
});
</script>
<input type="submit" name="testbutton" value="submit" id="testbutton" />
<input type="submit" name="testbutton" value="submit" id="testbutton2" />
With this solution, only the first button triggers the ajax call.