MVC ActionResult 和 QueryString
我对 QueryStrings 和 ActionResult 有点困惑
我有一个来自 jQuery 的 URL:
url: "/ToBePaid/Receipt/" + $(this).attr('value') + "&receipt=" + $ (this).attr('checked')
生成
/ToBePaid/Receipt/28cb8260-d179-450f-b9c4-162f1cc45bbd&receipt=true
,我的 ActionResult 如下:
public ActionResult ReceiptExpenseForGrouping(string id, stringreceipt)
以及我的内容我得到的是
id = "28cb8260-d179-450f-b9c4-162f1cc45bbd&receipt=true" 收据 =“true”= null
但我想要的是
id =“28cb8260-d179-450f-b9c4-162f1cc45bbd” 收据=“true”
请有人帮我吗?
I'm a little puzzled with QueryStrings and ActionResult
I have a URL coming in from jQuery as:
url: "/ToBePaid/Receipt/" + $(this).attr('value') + "&receipt=" + $(this).attr('checked')
which generates
/ToBePaid/Receipt/28cb8260-d179-450f-b9c4-162f1cc45bbd&receipt=true
and my ActionResult is as follows:
public ActionResult ReceiptExpenseForGrouping(string id, string receipt)
and what I am getting is
id = "28cb8260-d179-450f-b9c4-162f1cc45bbd&receipt=true"
receipt = "true" = null
But what I want is
id = "28cb8260-d179-450f-b9c4-162f1cc45bbd"
receipt = "true"
Please help me out here someone?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
应该能解决问题,
仁慈,
丹
Should do the trick,
Kindness,
Dan