Reputation: 349
I have the following jQuery/Ajax to be triggered on button clicked, on btn select click passs the selected radio button value to controller action and open detail page. but for some reason it gives me the following error
In Mozilla console
XML Parsing Error: no root element found Location: bill/bill/Details/43661 Line Number 1, Column 1:
In Chrome i get
POST bill/bill/Details/43661 405 (Method Not Allowed)
Upvotes: 0
Views: 1341
Reputation: 338326
From the comments it became clear that you actually want to load the '/Billing/Billing/Details/<id>
view on button click.
In this case an Ajax request does not help you. It's easier to directly set the URL of the current page:
$('#btnSelect').click(function () {
var selectedId = $('.invoiceID:checked').val();
window.location.pathname = '/Billing/Billing/Details/' + selectedId;
});
When you change any part of window.location
, the browser navigates to the new URL.
Upvotes: 1