简体   繁体   English

Asp XML 解析错误:找不到根元素位置

[英]Asp XML Parsing Error: no root element found Location

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.我有以下 jQuery/Ajax 要在单击按钮时触发,在 btn select click 上将选定的单选按钮值传递给控制器​​操作并打开详细信息页面。 but for some reason it gives me the following error但由于某种原因,它给了我以下错误

In Mozilla console在 Mozilla 控制台中

XML Parsing Error: no root element found Location: bill/bill/Details/43661 Line Number 1, Column 1: XML 解析错误:未找到根元素位置:bill/bill/Det​​ails/43661 第 1 行,第 1 列:

In Chrome i get在 Chrome 我得到

POST bill/bill/Details/43661 405 (Method Not Allowed) POST bill/bill/Det​​ails/43661 405(不允许的方法)

From the comments it became clear that you actually want to load the '/Billing/Billing/Details/<id> view on button click.从评论中可以清楚地看出,您实际上想要在单击按钮时加载'/Billing/Billing/Details/<id>视图。

In this case an Ajax request does not help you.在这种情况下,Ajax 请求对您没有帮助。 It's easier to directly set the URL of the current page:直接设置当前页面的URL更简单:

$('#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.当您更改window.location任何部分时,浏览器将导航到新 URL。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM