【发布时间】:2016-07-25 14:18:01
【问题描述】:
我有一个在 onclick 事件中进行 API 调用的 MVC 应用程序
<a href="javascript://" onclick="@Model.MyApiCall"></a>
@Model.MyApiCall 是一个看起来像这样的字符串:
window.location = 'http://localhost/myPath?myImagePath=http://myimagepath&width=360&category=2'
这成功调用了我的 API。到目前为止,一切都很好。 但是,由于某种原因,& 之后的所有内容都从 myImagePath 中截断。所以不是 myImagePath 等于我点击发送的内容,我只得到这个:
http://myimagepath
【问题讨论】:
标签: javascript c# asp.net-mvc url asp.net-web-api